Enable BackFaceCulling

Blitz3D Forums/Blitz3D Programming/Enable BackFaceCulling

Naughty Alien(Posted 2007) [#1]
..hey guys how to enable BackFaceCulling over some geometry of my choice, within code?? I know about Disabling it with EntityFx entity,16 , but how to enable it again, ??


Matty(Posted 2007) [#2]
Just call entityfx entity,0 again (or any combination that does not include the 16)


Naughty Alien(Posted 2007) [#3]
..Entityfx entity,0 doesnt work...I have level exported from giles, and inside giles I left it double sided because of proper shadow casting..so, now im loading level with loadanimmesh and accessing few childs in order to enable BackFaceCulling...so, its just not working..hmm


Danny(Posted 2007) [#4]
You say 'accesssing a few childs' but are you sure you recursively go through EVERY possible child?? if not, that could explain it...

D.


Naughty Alien(Posted 2007) [#5]
well..thats what I thought, after that I manually pick up child I wanted (4 of them) and same result...not working..I tried to control some other aspects of it, like hideentity, just to be sure that I picked them, and its working, but enabling BackFaceCulling doesnt work..I dont know why..


Stevie G(Posted 2007) [#6]
If each entity has several surfaces - have you tried setting up a brush, applying brushfx and paintsurface?


Zethrax(Posted 2007) [#7]
What are you trying to do with the backface? I believe disabling backface culling will only affect the rendering of the backface polygons. All the dynamics stuff (collisions, picking, etc) won't work on polygon backfaces even if you enable them.

If you want dynamics to work you'll need to create a mesh copy of the geometry and FlipMesh it so that the polygon frontface of the copy is facing in the same direction as the backface of the original.


Ross C(Posted 2007) [#8]
Hmmm, maybe your modeller has created and saved extra surface/polygons?


Naughty Alien(Posted 2007) [#9]
...in Giles I had enabled doubleside, for specific objects, regarding proper shadow casting...so I just wanted to turn it off, since I dont need them anymore...but it seems that I cant handle it from within code...so I just export it again from Giles with disabled doubleside, and its okay...Im still wondering what went wrong with same thing in code..


Dreamora(Posted 2007) [#10]
you could do a lazy test: export from giles as b3d with it, reimport it and check if you can disable it now.

If yes, then you just tried to disable it on the wrong object or on the wrong level on the hiearchy (not the actual mesh entity but its parent for example)


Stevie G(Posted 2007) [#11]
With doubleside on, Gile(s) must have created the new polygons, not simply applied fx 16. This will be the reason turning backface off won't work. You could check this by counting the triangles on both versions.

Stevie