Will advanced techniques be supported?

  • Posts: 177
4 years 1 week ago - 4 years 1 week ago #1 by luluco250
Excuse me in advance for possible lack of technical knowledge, but when programming/scripting shaders in Unity you can do neat stuff like loops for passes, change texture sizes, get rid of textures altogether when not necessary anymore, would this be supported in any way in the future?

Let's say you want to do a simple multi-pass blur filter and don't want to be forced to write multiple passes, could one do a loop of passes instead?
Also the whole temporary textures concept would be great for things like brightpass/threshold, ping-pong etc.
Maybe a small scripting API could help achieve this?

A bit offtopic so I'll spoiler it:
Warning: Spoiler! [ Click to expand ]


By the way, great work on the in-game UI!
The following user(s) said Thank You: crosire

Please Log in or Create an account to join the conversation.

  • Posts: 3723
4 years 1 week ago - 4 years 1 week ago #2 by crosire
Sure. Possible in theory. Just needs a nice syntax. That is, pass loops etc. The texture size is fixed for performance reasons.

As for HDR: This is not likely to happen. Not every game has a HDR intermediate step and there is no standardized way of doing it, so it would be very hard to detect. You can create HDR target textures with ReShade during post-processing, but the game input is always LDR (because the final output buffer is LDR, since drivers usually don't support anything higher).
The following user(s) said Thank You: luluco250

Please Log in or Create an account to join the conversation.

  • Posts: 177
4 years 1 week ago #3 by luluco250
Alright, I guess I'll mess around with creating HDR using Bloom and other effects and tonemap it, but it can be a bit complicated due to not being able to read/write from the same texture unless it's the backbuffer, but that can be fixed with ping-ponging.

Thanks for the feedback!

Please Log in or Create an account to join the conversation.

  • Posts: 177
3 years 11 months ago #4 by luluco250
Hey, sorry for necroing this thread but I just wanted to show I managed to implement HDR on ReShade!

gfycat.com/MerryDecimalCarpenterant

Please Log in or Create an account to join the conversation.

  • Posts: 3723
3 years 11 months ago - 3 years 11 months ago #5 by crosire
Nice job. Although technically that's lighting adaption, not HDR. HDR isn't an effect, but a way to render scenes with more precise lighting information in a larger range, so details are preserved better and effects like adaption etc. have more information to work with.

Please Log in or Create an account to join the conversation.

  • Posts: 177
3 years 11 months ago - 3 years 11 months ago #6 by luluco250
I know what real HDR is (I have worked this bloom shader on Unity with real HDR), I made a shader that curves up the LDR backbuffer into an HDR texture using lerp and smoothstep, essentially thresholding.

It's not real HDR but it does what I need it to nicely.

Edit, here's how it works:

2 RGBA16F textures are created, one main and another for read/write.

Fake HDR shader writes to the main texture by thresholding the backbuffer, anything above that threshold is multiplied by a configurable value, using smoothstep this threshold is, obviously, smooth.

Any shader that requires read/write of HDR in the same pass can simply make use of a pre-created "CopyHDRtoTex" function and copy the current HDR to the second texture.

At the end of the pipeline before LDR shaders a tonemapping shader works on the main texture and writes to the backbuffer.

So it both is and isn't real HDR.
The following user(s) said Thank You: jas01

Please Log in or Create an account to join the conversation.

  • Posts: 3723
3 years 11 months ago #7 by crosire
I see =). Interesting approach!

Please Log in or Create an account to join the conversation.