Advertisement Jump to content
Sign in to follow this  
Kiel368

Unity Transparency problem in voxel terrain!

This topic is 1840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi!

I'm working in unity3D and trying to make glass in my voxel engine. I enabled alpha blending, but it resulted in voxels with solid textures also being transparent!
How to make transparent textures properly? Can one mesh be transparent and solid at once or I have to create a dedicated mesh for transparent materials? (World is divided in regions, each one has its terrain mesh) confused.pngconfused.pngconfused.png

 

Thanks for your help.

Share this post


Link to post
Share on other sites
Advertisement

not sure about the specifics of Unity 3D, but in general:

draw solid geometry first;

then draw transparent geometry in back-to-front order.

 

generally, yes, solid geometry and transparent geometry are kept separate.

 

 

in my engine, the chunks with transparent geometry are essentially sorted by their distance from the camera, then transparent geometry is drawn with the furthest chunks drawn first.

this seems to mostly work.

 

a few things are also drawn with depth-writes disabled, which also has sometimes "interesting" side-effects, but is needed to help reduce problems with intersecting geometry causing ugly self-clipping artifacts. if transparent geometry is drawn in-general this way, rather than out-of-order drawing resulting in things being not-drawn, it will result in blending issues. usually, the blending issues are slightly less ugly though.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!