#Object renders on top of another when shading

1 messages · Page 1 of 1 (latest)

amber bobcat
#

Okay guys, I'm having an issue with an object rendering on top of the other when making a shader for a fireball of sorts. I don't understand what goes on.

I have two objects with the same shader. One of them is an elongated hemisphere, for the main fireball, and the other one is a cillinder with no bases, for the trail. I want the fireball to always be rendered on top of the trail, but when the camera is "behind" the object, it renders the trail on top of the fireball. I don't understand why that happens, help please?

fading trail
#

You could apply same shader but different materials to each section, adjusting the Sorting Priority (or render queue) on one to force the render order

#

Alternatively, may be able to combine the objects/meshes in modelling software (i.e. Blender). But need to combine them in a specific way to make sure the main fireball faces appear over the trail faces. See example

amber bobcat
#

I've give it a try, adjusting the sorting priority fixed the issue

frosty geyser
#

If that's a limitation the mesh combining method may be the best

#

But if they must remain separate objects my method would be a script that offsets the parts towards or away from the camera ever so slightly so that they resolve the depth difference only between them exactly as you want