Backface Culling

Blitz3D Forums/Blitz3D Programming/Backface Culling

Buggy(Posted 2007) [#1]
The manual says to use EntityFX 16 (which supposedly disables backface culling) on free-moving sprites. Unfortunately, this makes the sprites completely black. Is this a glitch? Is there a fix? Should I just have two back-to-back sprites and not worry about it?


GfK(Posted 2007) [#2]
You should maybe post some code, as EntityFX Entity,16 should work fine with sprites.


Buggy(Posted 2007) [#3]
All I did was:

sprite = LoadSprite("s.PNG")
EntityFX sprite, 16
HideEntity sprite

...

s.thing = New thing

s\entity = CopyEntity(sprite)


The s\entity shows up completely black. I know this because when it is over a non-black background, I can see it. The sprite is normally white. This happens even if I explicitly say:
EntityColor sprite, 255, 255, 255


However, if I don't use EntityFX sprite, 16 in the beginning, then it isn't backface culled but at least I can see the sprites normally.


big10p(Posted 2007) [#4]
That code kind of works here, in as much as I can see the sprite. However, using EntityFX 16 causes the sprite to be alpha blended, for some reason. Using specific LoadSprite flags and setting the alpha level to 1 doesn't have a any effect. God knows what's going on - I don't use sprites very often, TBH.


DJWoodgate(Posted 2007) [#5]
I think sprites are fullbright by default so you need to do Entityfx sprite,17 to maintain that property with backface culling unless you want your sprites to depend on ambient and other lights in which case there are one or two points to note. Ambient light seems to effect the sprite as you would expect. Other Light types will make the sprite full bright regardless of intensity or color.


Buggy(Posted 2007) [#6]
Thanks a lot. That's probably el problemo.