0 votes

I posted this question on blender stackexchange earlier and got no good answers. My goal is ultimately to make this work in godot, so I figured I'd ask here to.

So what I want is to just make the object/mesh transparent as a "filter" instead of giving it a transparent material which will show the inside/behind faces.

This is currently what I'm getting:
wrong render

This is what I want to get (done using post editing)
enter image description here

All of this is demonstrated using blender, but the exact same thing happens in godot, so I don't feel the need to upload a sample project, I can provide one if needed.

in Engine by (15 points)

In Godot, the result you are getting is obtained by having the double sided option enabled on the material, so I think you have to disable it. If materials are directly in the mesh however, I'm not sure how you can do this, maybe something in Blender to prevent backfaces from being rendered, or add a material override in Godot.

However that doesn't fixes all cases, I tried with Suzanne (the monkey from Blender) and you can see outside faces through the model. In theory, there is nothing wrong with it, because you can see through the model (because it's transparent) and outside faces are supposed to be seen. What you want (judging by your screenshot), is to not be able to see anything of this model through itself... I don't see any option in Godot to do that, unfortunately :(
I think there are ways, of course, but not as simple as setting flags in a material.
It has to do with the depth buffer, like, drawing the mesh as if it was opaque, but the result must be made transparent. Maybe use a render-to-texture? (but may come with drawbacks).

If anyone knows, correct me if I'm wrong, because I'm not experienced yet in the 3D side of Godot 2.x ^^"

However if disabling double sided is enough for you, I might move this comment as answer.

1 Answer

+2 votes
Best answer

It looks like your normals are messed up ( hit ctrl+n to have blender normalize them ).

But even with that the bits that goes inside it ( eyes / mouth ) will have an interior wall visible - grab a glass and look at it from the side, you will still be able to see the inside wall facing you.

You can still achieve the look in the 2nd picture by doing more or less the same in godot that you did in post by doing RTT + billboarding.

First render the model to a seperate viewport and then for the rendering pass replace the model with a billboard ( a quad that always faces the camera ) this billboard you give opacity.

Being new to godot I may have the terminology wrong, but you can find an example of RTT (render to texture) in the examples viewport/3din2d/ - they use the resulting texture in 2d but there is no reason you can't use it as a texture.

Note: with this trick the rending will look correct but remember that your billboard needs to have the collision box from the actual model or it wont collide properly ( which given it's ghost like appearance may be what you want ;) )

by (366 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.