Posted September 8, 20205 yr I am trying to render a cube that varys its tranperency (starts by alpha=0 to alpha =1) that is working but if i look through the cube i cant see things that use transperency themself. Like water, glass blocks or so. While blocks like Ice or tinted glass do not have this issue. Is there an OpenGl option that fixes that? Or if not another solution?
September 8, 20205 yr Welcome to the quest to find the holy grail of computing: transparency sorting. Whatever you did (which you didn't show your code) caused the polygons you tried to render to occlude the transparent blocks at a time when the triangle sorting was set to "nearest first". Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
September 8, 20205 yr Author Here would be my renderer. By disableing the depthTest or depthMask I can achieve what I initialy wanted but it still seems a bit off (And i am not sure its the right way) and the rest of the block (the cube is just a part of one) is always rendered before the cube so that if looked at through the tinted face of the cube the rest does not seems to be affected. https://pastebin.com/gXS6m7iP
September 8, 20205 yr Author In case the full repo is usefull: https://github.com/Orothuin/Forge-Forum-Version
September 9, 20205 yr Author Okay thx for the key-word. I red something about the matter and what i can get from it, is that my current code does render both water and cube because i do not let the cube write to the depth buffer and thus the water is not occluded (And translucent and opaque triangles seem to be handled differently since the opaque blocks are never occluded by the cube). But still I do not sort the alpha triangles correctly so that in the current state water is rendered over the cube but does blend in a bit with the cubes color. Is that somewhere near the truth?
September 9, 20205 yr Author By the way the problem with the rest of the cubes block was, that i set its render layer to (due to the glass part in it) to translucent. Ill just have to render the glass box in the renderer too
September 9, 20205 yr Author Ok that worked I now exclude both the glass box and the cube inside from the depth buffer and it looks well enough. Thanks again for the key-word. Did not had a clue what to look for.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.