FlaxEngine icon indicating copy to clipboard operation
FlaxEngine copied to clipboard

Software reflections for forward pass

Open HydrogenC opened this issue 1 year ago • 2 comments

Add software reflections support for forward pass materials, fixes #2703.
Note: Now SDF reflections is enabled together with SSR, and it takes 7 texture slots and it's costly, so maybe we shall add a separate material option to enable or disable it to avoid waste of texture slots.

Showcase: SoftRefl

The third picture may not look as good as the first one since there's no SSR blurring in forward pass, but it quite resembles the first overall. The strange patterns (also seen in the opaque version) are due to the inaccuracy of the SDF itself, not caused by rendering artifacts.

HydrogenC avatar Jun 18 '24 13:06 HydrogenC

my hero 😱😱 can we get this in master asap?

abrasivetroop avatar Jun 18 '24 15:06 abrasivetroop

Note: This change would crash the engine due to size mismatch of the buffer if the material shader isn't recompiled after the code change, so it would be necessary to flush the material shader cache and recompile with the new forward template. How to force the engine to rebuild all materials?

HydrogenC avatar Jun 19 '24 12:06 HydrogenC

Incrementing macro MATERIAL_GRAPH_VERSION handles material shaders regeneration. I'll take care of that during merge.

mafiesto4 avatar Aug 05 '24 17:08 mafiesto4