About Store Forum Documentation Contact



Post Reply 
Draw 'on front'
Author Message
menajev Offline
Member

Post: #1
Draw 'on front'
Is there a way to draw mesh at any position but to be always visible regardless of any othere meshes between it and camera? Something like drawBehind but to look exactly same as when drawing using drawPrepare.

Drawing it in second Renderer iteration with .combine work just perfect, but it affects performance too much.
09-29-2019 06:04 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Draw 'on front'
You'd have to adjust the engine source code, for example make some new drawing method that's executed after normal rendering finished. And there use a different depth buffer, or just disable it altogether.
10-02-2019 02:36 PM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #3
RE: Draw 'on front'
Would it not be possible to override this with SetMatrix though? at the very least you can transform a separate matrix which is scaled according to the distance it is moved towards the camera and render and render the object that way, although it would still be affected by clipping etc.

not sure if there is a way to override the shader itself and use a shader which ignores depth
(This post was last modified: 10-03-2019 06:12 AM by Zervox.)
10-03-2019 05:48 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Draw 'on front'
Actually my idea will not work well if you use deferred renderer with non alpha blended materials. It's pretty complex to solve this, as it depends on deferred /forward renderer and on alpha blended or non blended materials, each would require different approach.
Zervox approach to use matrix closer to camera is interesting but it will give you only some bias to the depth, there may still be objects that are in front of it.
10-04-2019 06:45 AM
Find all posts by this user Quote this message in a reply
Post Reply