Jump to content

Make objects appear on top - always


SpiderPig
 Share

Go to solution Solved by Josh,

Recommended Posts

I think what I need is to disable depth testing but it didn't do what I expected.  The models that this material is applied to are small and are sometimes inside other objects, I just want them to be always onto of everything.

debug_point_material = CreateMaterial();
debug_point_material->SetShaderFamily(LoadShaderFamily("Shaders\\Unlit.json"));
debug_point_material->SetShadow(false);
debug_point_material->SetDepthMask(false);
debug_point_material->SetDepthTest(false);

 

Link to comment
Share on other sites

  • Solution

I've had some trouble disabling depth testing. Not sure what is going on. I ended up using a second camera and rendering that on top of the scene, and had much better results with this.

  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

It's not enough just to disable depth testing. You have to render that object last, which means it needs to appear after all transparent objects. But then transparency has two render paths, once for conventional transparency, another for transparency with refraction. So I just haven't bothered trying to work that all out, and I'm not sure it's even worthwhile when a second camera works perfectly.

  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Yeah, and then there is the issue of ordering of multiple objects that both have depth testing disabled...the second camera is more versatile anyways.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...