Transparent sticker colours


Transparent sticker colours
#1
How come the transparent colours aren't visible from the backside?

I'm reworking this sticker. It should have a transparent multi coloured print.

   

But, no matter how I try, using BFC Noclip, the colours are lost when I flip it over and look at it from the reverse side.
Reply
RE: Transparent sticker colours
#2
Is this a case where the two-sided transparency setting comes into effect? (I have never quite understood exactly what that does…)
Reply
RE: Transparent sticker colours
#3
(2025-09-14, 13:54)Magnus Forsberg Wrote: How come the transparent colours aren't visible from the backside?

I'm reworking this sticker. It should have a transparent multi coloured print.



But, no matter how I try, using BFC Noclip, the colours are lost when I flip it over and look at it from the reverse side.

It looks like a Z sorting problem, although I could be wrong. If you remove the back face, does the invisible geometry reappear? If so, then that is more likely than BFC.

Background: A standard way to draw transparent parts (used by LDView; not sure about LDCad) is to first sort them in order by "depth into the screen"*, then draw them from back to front. However, the sorting is a lot harder than it seem like it should be, and if they get drawn in the wrong order, then the front ones may prevent the back ones from being visible. I think that in LDView, you end up with artifacts, but the geometry is still visible. It could be that in LDCad the geometry just disappears.

* This is an over-simplification, but hopefully it gets the point across.
Reply
RE: Transparent sticker colours
#4
Yes, if I remove the back face of the sticker it works. 
And even if I place a trans_clear window behind the sticker, I see the transparent pattern, if the backside is removed
Reply
RE: Transparent sticker colours
#5
(2025-09-14, 13:54)Magnus Forsberg Wrote: How come the transparent colours aren't visible from the backside?

Like Travis wrote, this is a z-sorting thing.

With LDCad I made the decision to do part level sorting only. Meaning it will sort and then draw (partial)transparent parts from back to front.

But with parts like this one that's not good enough in regards of the order of polygons in the part itself. 

The decision was mostly about speed because it gave a decent result for most parts while being almost 'free' load wise.

With modern hardware you can do things like shader per pixel z-sorting. Then you don't have worry about the draw order at all. But that's something for the 2.0 rendering engine.

The transparent dual sided lighting option mentioned above was to somewhat improve rendering of these parts. 

But things might still look weird because colour blending is also order depended.
Reply
RE: Transparent sticker colours
#6
In This case would putting the whole sticker, including the box, in NOCLIP status help?
Reply
RE: Transparent sticker colours
#7
(Yesterday, 19:54)Orion Pobursky Wrote: In This case would putting the whole sticker, including the box, in NOCLIP status help?

Made a glass + sticker shortcut with the whole sticker NOCLIP. Didn't work
Reply
RE: Transparent sticker colours
#8
Hmm. Well I guess we have to accept that this is a rendering limitation. 

What happens if you import it into Studio and render it with eyesight? Or export to POV-Ray?
Reply
RE: Transparent sticker colours
#9
(Yesterday, 19:54)Orion Pobursky Wrote: In This case would putting the whole sticker, including the box, in NOCLIP status help?

That's what the "transparent dual sided lighting" option does, it forces dual rendering (aka noclip) for any part containing transparent polygons.

This will make it visible from the back, but won't fix the flawed alpha blending of colours inside the part itself.
Reply
RE: Transparent sticker colours
#10
(Yesterday, 21:32)Orion Pobursky Wrote: Hmm. Well I guess we have to accept that this is a rendering limitation. 

What happens if you import it into Studio and render it with eyesight? Or export to POV-Ray?

I'm no good at rendering, but it seams to work well with an export to POV-Ray from LDCad with default settings.

   
Reply
RE: Transparent sticker colours
#11
(Yesterday, 19:38)Roland Melkert Wrote: Like Travis wrote, this is a z-sorting thing.

With LDCad I made the decision to do part level sorting only. Meaning it will sort and then draw (partial)transparent parts from back to front.

But with parts like this one that's not good enough in regards of the order of polygons in the part itself. 

The decision was mostly about speed because it gave a decent result for most parts while being almost 'free' load wise.

With modern hardware you can do things like shader per pixel z-sorting. Then you don't have worry about the draw order at all. But that's something for the 2.0 rendering engine.

The transparent dual sided lighting option mentioned above was to somewhat improve rendering of these parts. 

But things might still look weird because colour blending is also order depended.

I would suggest turning off Z writing while rendering transparent geometry to see if it improves things. Things still won't look right, but at least geometry won't disappear entirely. And it could be as little as two lines of code. (One to disable Z writing prior to drawing the transparent geometry and another to re-enable it.)

Code:
glDepthMask(GL_FALSE);
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 3 Guest(s)