- Home /
Transparency with correct culling
Imagine the camera looking the main character's back, I want to see tru it, let's say the enemies in front of my character, but I don't want to see my own character's arms that should be occluded by it's back
If I make it transparent , the arms can be seen tru the back, which is wrong, then I need the culling to happen correctly ( back culling is not the solution )
Then I need first to get the correct culling, and then make it transparent, I know how to do that with render targets, although I don't have unity pro
Is there a way to do that with the Unity basic version?
Thank you
(edited to clarify the problem)
Uhmm. the point of transparent objects is to see what is behind it don't you think? So you want to cull certain things but not everything? I think i don't get what you want. Can you add a screenshot that shows your problem?
Imagine the camera looking the main character's back, I want to see tru it, let's say the enemies in front of my character, but I don't want to see my own character's arms that should be occluded by it's back
I don't have my unity computer handy, I'll post a screenshot later
Thank you
Hi Alpha Blending and Alpha test is good option you just need to use texture with alpha where you want transparency. but Alpha test used more resource then alpha blending and it's sometime killing the game when we trying it for device like iOS or android device
Thanks RAJPatel
I don't think a texture with alpha would work, because the transparency is not static, it depends on the perspective of the camera
Hi Jorg I think you have a simple option move your camera little above on Y Axis. As Second option just put your camera it little bit over and back side of your player head with rotation downside X axis, and script will tack care of movement of your camera as per your player / character position
you can find the ready script on car Tutorial project of Unity3D. the script is whoToLookAt.js.
Answer by PAHeartBeat · Aug 08, 2012 at 10:09 AM
Hi Jog
As I have not much experience in Unity3D but you can go with lerp and culling with shader option, you will find more option from Jessy's video tutorial for shader lab. I go through it and it's work for me. I used same technique in game Crazy Monster Truck - Escape for power feed back animation
link: http://www.youtube.com/watch?v=6Eyk-KU56ow http://www.youtube.com/user/JessyUV?feature=watch
Answer by Bunny83 · Aug 08, 2012 at 10:56 AM
The only way to render this unusual setup is that you have your arms seperate from your body. Otherwise there's no way to control in which order things are drawn. Transparency means you use alpha blending in the shader. So as first step all opaque objects are drawn and then all transparent objects are drawn sorted from far to near. Transparent geometry usually doesn't write to the z-buffer. Transparent geometry can't occlude other things.
You can fake this effect without problems, but only when your arms are seperate objects.
You can't specify the order in which the triangles of your character are drawn.
If you really need just the back, you can try to put a plane in the center of your character and use the depth-mask-shader.
Your answer
Follow this Question
Related Questions
Change blend mode from outside shader? 3 Answers
Transparency shader problem 5 Answers
Sorting issues within single transparent mesh 1 Answer
Need help with opacity error 0 Answers
Blending and Decaying Alphas 0 Answers