alpha transparency and surface culling

Blitz3D Forums/Blitz3D Beginners Area/alpha transparency and surface culling

AdamRedwoods(Posted 2013) [#1]
i'm curious what the blitz3d behavior is towards transparency and backface culling:
when you have a transparent object, do you need to activate EntityFX 16, or is it on automatically? this would disable backface culling.

(i dont have blitz3d, i am replicating this behavior for minib3d+monkey)


RemiD(Posted 2013) [#2]
Edit : Backface culling is on by default.
Disable backface culling is off by default.

It is not necessarily for a transparent object, it is to tell blitz3d if a tri has to be drawn on one side or on 2 sides "recto verso"


AdamRedwoods(Posted 2013) [#3]
thank you.

so to clarify, if you do "EntityAlpha ent, 0.5" Blitz will automatically turn off backface culling, which is equivalent to "EntityFX ent, 16".


Yasha(Posted 2013) [#4]
Uh, no? Quite the reverse. Backface culling is completely unaffected by alpha and will only be off if it was turned off manually. I don't know what RemiD is thinking of (perhaps that backfaces themselves are off by default?), because this is easily verified.

Anyway, when it comes to alpha, Blitz3D is mainly notable for the fact that it doesn't handle complex meshes very well at all, as it can't Z-order the polygons, so this issue will rarely come up in original-B3D code as one normally tries to avoid using alpha with anything that isn't either very simple or perfectly convex. If you have the option to deviate from the original's behaviour in this respect, I would recommend taking it and making alpha just work properly.


RemiD(Posted 2013) [#5]

so to clarify, if you do "EntityAlpha ent, 0.5" Blitz will automatically turn off backface culling, which is equivalent to "EntityFX ent, 16".


No.

backface culling and alpha are 2 different things.

I made an error in my previous post i will edit.
Backface culling is on by default, disable backface culling is off by default.

Download the demo and see :



AdamRedwoods(Posted 2013) [#6]
ok, thanks for the info!


Kryzon(Posted 2013) [#7]
To clarify for others that read this thread and get confused:

Backface culling: a feature that hides faces that face away from the camera. This feature is on by default.

Entity FX #16: disables the above feature, so back faces are also included in the rendering. They will be rendered for sure, but you still won't see them as the front faces of the mesh are always drawn on top of them.

EntityAlpha: controls an entity's transparency. Does not affect the culling of back or front faces in any way.

- - - - -
If you want a transparent object with its back faces visible, not only will you have to call an EntityAlpha on it, you'll also have to 'disable the hiding' of its backfaces with an EntityFX entity, 16.


_PJ_(Posted 2013) [#8]
Then there's FlipMesh...