-
Notifications
You must be signed in to change notification settings - Fork 8
gotta watch out for side-stretching #2
Comments
Just leaving this here as a note: since Godot does not let you access the normal buffer, I was hoping I could use the depth buffer and take the derivative of that to get the normal of the screen and then from there I can implement angle-threshold. |
that sounds somewhat fragile. This may just need to be a thing that the developer should watch out for when designing. @Mr-Slurpy more importantly, have you thought of a way to isolate the decal to specific surfaces or meshes? E.g. if I draw a puddle splatter on a floor, if my 3d character steps on it, then the splatter would also render on the character's feet. Ideally this should only be drawn over the direct parent meshes. This link doesn't highlight the issue. For some reason I've had a hard time finding out why it's not a mentioned issue. |
https://mtnphil.wordpress.com/2014/05/24/decals-deferred-rendering/ Ah this blog mentions the problem. Two solutions. Draw dynamic moving objects afterwards. Not ideal. |
I think the only way to not do decal render on only specific objects would be to just render them after the decal. I don't think it's that difficult since Godot lets you specify the render order of your materials. So you could set the scene to render priority of 0, the decal to 1 and dynamic objects to 2. The other solution is nice but it has some problems. To do that you would have to render the entire scene to a separate buffer (preferably a stencil buffer (which Godot doesn't support)) and in Godot this is very gimmicky. You would also limit the amount of unique objects you can display but it's such a high cap that it's just a nitpick. I think right now the above solution will do for now. And even though admittedly my fix for the angle-threshold is a little hacky, I'd still like to try it. At the very least I can make it an optional addition if users don't like the behavior. (Of course, the angle would be adjustable.) |
hm I didn't get much luck with the render priority. It seems the depth disabled option will override the render priority. However if I do set the character material to have ALPHA being detected it will render. I haven't figured out in the godot code how the use_alpha would be affecting the rendering pipeline. |
http://blog.wolfire.com/2009/06/how-to-project-decals/ I also wonder whether the mesh generation method would be fast-enough if it took advantage of the CSG module. |
https://pompidev.net/2014/12/02/projecting-a-dynamic-decal-on-a-3d-mesh/ more notes to myself. Sorry for the spam. |
we'll need to come up with some sort of angle-threshold
The text was updated successfully, but these errors were encountered: