Jump to content

  • Log In with Google      Sign In   
  • Create Account


Transparency problem in voxel terrain!


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Kiel368   Members   -  Reputation: 206

Like
0Likes
Like

Posted 08 January 2014 - 09:15 AM

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.



Sponsor:

#2 BGB   Crossbones+   -  Reputation: 1461

Like
0Likes
Like

Posted 08 January 2014 - 12:26 PM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS