Jump to content

[SOLVED] ObjectDynamic and scattering


photo

Recommended Posts

We are using ObjectDynamic to render some lines, but when we use coloured lines, whenever the line is over the water or sky, the colour disappears. It seems to have to do with light scattering, when I tried it in the ObjectDynamic lines shader sample the tree turned black when I enabled scattering on one of the lights:

post-999-0-70327500-1417788796_thumb.png

 

I tried setting the material to post scattering, but this alone didn't help, when playing around with alpha blending settings it did fix the problem for some lines, but not all of them, as some other lines completely disappeared when enabling alpha blending. Does anyone know a proper way of rendering lines through ObjectDynamic that works with light scattering? Also is there some way to make the lines always on top (disable depth testing)?

Link to comment

Hi,

You can add a deferred shader to get the correct distance to the line.

As an example you can add the following to the lines material:

<shader pass="deferred" object="dynamic"
            defines="BASE_DEFERRED"
            vertex="core/shaders/default/mesh/vertex_base.shader"
            fragment="core/shaders/default/mesh/fragment_base_deferred.shader"/>
Link to comment
×
×
  • Create New...