Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Texture replacement #1481

Open
aschrein opened this issue Aug 3, 2019 · 3 comments
Open

[Feature] Texture replacement #1481

aschrein opened this issue Aug 3, 2019 · 3 comments
Labels
Feature An improvement or feature Unresolved Waiting for a fix or implementation

Comments

@aschrein
Copy link

aschrein commented Aug 3, 2019

I prototyped a hack that replaces textures with checkerboard pattern for DirectX 11. A lot of people showed interest in this and I decided it's worth making a feature request.

The way it works in my hack is by supporting a set of replaced ResourceIds and a cache for ResourceId->SRV and then checking for that mapping in places like this for VS, CS and PS. The result is that the replacement texture now appears on all render targets and on the thumbnails. It doesn't alter the UAVs and RTVs, just SRV replacement.

I don't have enough experience with the sources so I don't know what is the best architecture for such a feature. But I do have an approximate list of UI knobs:

  • Select the checkerboard parameters: 1st value, 2nd value, step in pixels
    • Not sure how to set up values for different types. In my example I restricted to 32bit per pixel
  • Select the checkerboard format i.e. R32_FLOAT, R8G8B8A8_UNORM etc
  • A button to remove all replacements
  • A button to update all replacements with new parameters
  • A context menu item for the selected texture

A more advanced approach would be to dispatch a compute shader and bind the copied texture as a UAV, in that way the user can choose it's own pattern or even replace only part of the texture without being restricted to the checkerboard. This is similar to the custom visualization shaders with an extra step of replacement.

Thanks

Example(the captured frame is unrelevant):
https://youtu.be/mwFNchuA4jc

@baldurk
Copy link
Owner

baldurk commented Aug 5, 2019

I'm glad you were able to implement this feature for your uses, one of the primary advantages of open source is allowing this kind of experiment.

Editing of captures is certainly a desirable feature but it's also a massively complicated one, and it has a lot of UI and design implications. The set of functionality and control you've implemented is useful for your case, but it's very focussed on your needs and would change a lot and gain many new challenges if it were generalised into something that could be implemented in the main build.

I can leave this issue open as a feature request but being honest I have no idea when such a thing might be implemented.

@baldurk baldurk added Feature An improvement or feature Unresolved Waiting for a fix or implementation labels Aug 5, 2019
@aschrein
Copy link
Author

aschrein commented Aug 6, 2019

Thanks for your answer.

I didn't mean to generalize to capture editing. It's more like input data editing, which is supported in intel GPA, for example. RenderDoc already does shader replacement which is along the lines, I believe. But you're probably right that this is quite niche.

@xoyojank
Copy link

+1
sometimes we want to replace a texture to compare the rendering results or performances

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature An improvement or feature Unresolved Waiting for a fix or implementation
Projects
None yet
Development

No branches or pull requests

3 participants