Simon.Anderson Posted July 14, 2015 Posted July 14, 2015 Hi all, I need a "post processing" effect that enables me to grey out everything in a view/scene except a particular group of 3d models I'm interested in looking at. Does anyone have an example of how this can be done? Do I need a black and white shader? Is there anything in the unigine examples that may be of help? BTW this has to be done dynamically/programmatically at run time. Thanks! Simon
ulf.schroeter Posted July 14, 2015 Posted July 14, 2015 Such an effect can be achieve by a combination of auxiliary buffer rendering (mask creation) and customized composite shader (selected gray-out). For mask creation of the particular group of 3d models which should be highlighted these modells will have to be rendered to the auxiliary buffer. This can be achieved by enabling the auxiliary buffer render-pass for the material used for rendering these specific 3d models (see docs). The auxiliary texture will then contain non-zero pixel values for all objects NOT to grey-out After scene rendering the final grey-out effect will be done in a customized composite shader. The composite shader has both access to the render texture and the auxiliary texture. Within the composite shader simply test for each pixel the auxiliary texture value: if it is non-zero (=masked object pixel) simply output the normal RGB color, if it is zero apply e.g. a grey-scale transformation on the pixel color and output this to the final render texture. There should be several unigine material saples showing per-object glow/blur effects. Use these examples and the related material/composite shaders as a blue-print for your implementation (example screenshots using similar approach). 1
Recommended Posts