Distance based optimization material instructions. Switching the set of instructions in the material during rendering.
I'm trying to create a material that will be optimized as the camera moves away from the surface. In the near material used large sets of instructions, such as parallax. When using the IF node, the material editor generates the error: [SM5] (Node If) Failed to compile AGreaterThanB input. Nod SWITCH not suitable, because is static. I also know that I can use LODs, but I want to do this in the material, because in my project, LODs is not convenient to use.
Is it possible to implement such a material, as in the attached picture? Is it possible to dynamically control the shader's instruction kit during rendering? Please tell me what methods to implement my idea without LODs materials sets.
Once the shader code is compiled its instruction count remains constant. It is irrelevant what kind of data is running through it, every instruction will be executed, even if the end result doesn't even change a pixel in the final image. This is due to the architecture of the GPU: Single instruction - multiple data (SIMD: https://en.wikipedia.org/wiki/SIMD) One program fed by different data for each pixel.
answered Jan 14 '19 at 02:28 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here