Page 1 of 1
Invisible walls
Posted: Fri Nov 23, 2007 6:42 pm
by Cruel dog
hello, Could anyone give me the easyest way to make an invisible wall? Thanks!
Posted: Fri Nov 23, 2007 6:45 pm
by F687/s
Code: Select all
material
name invisible
color 0 0 0 0
end
meshbox
position 0 0 0
size 10 10 10
matref invisible
end
Hope that helps.
Posted: Sun Nov 25, 2007 11:03 pm
by optic delusion
if you are using lots and lots of invisible walls, it might be better to use an invisible texture
http://images.bzflag.org/pmatous/transparent/
Posted: Sun Nov 25, 2007 11:59 pm
by Legolas_
Expanding on Optic's post :
Code: Select all
material
name invisible
texture http://images.bzflag.org/pmatous/transparent/Trans-100.png
end
meshox
position 0 0 0
size 10 10 10
matref invisible
end
I'm not exactly sure what the reasoning behind this being better, except perchance that it makes the map load faster.
Posted: Mon Nov 26, 2007 1:02 am
by Joe-Schmoe
It increases fps as well, not sure how.
Posted: Mon Nov 26, 2007 1:31 pm
by Peter
You can make an invisible object with just one line of code...
Code: Select all
meshbox
position 0 0 0
size 100 2 20
rotation 45
diffuse 0 0 0 0
end
Posted: Mon Nov 26, 2007 2:28 pm
by Legolas_
PETER wrote:You can make an invisible object with just one line of code...
Code: Select all
meshbox
position 0 0 0
size 100 2 20
rotation 45
diffuse 0 0 0 0
end
That may be the easiest, but we are trying to figure out which way is the best for many objects.
Posted: Mon Nov 26, 2007 4:22 pm
by Peter
Legolas_ wrote:
That may be the easiest, but we are trying to figure out which way is the best for many objects.
Okay then, I think you can do this with groups...
Code: Select all
define many_objects
meshbox
position 0 0 1
size 10 10 1
rotation 0
end
meshbox
position 0 0 2
size 10 10 1
rotation 0
end
meshbox
position 0 0 3
size 10 10 1
rotation 0
end
enddef
group many_objects
scale 1 1 1 # Scale if you want
shift 0 0 0
diffuse 0 0 0 0 #Where did all those objects go?
end
Posted: Mon Nov 26, 2007 4:57 pm
by optic delusion
It has to do with backface culling. The faces of an object that you can't see, because they are behind another face. When you add transparency.. they suddenly become visible.
I just did a little research, and it seems that the devs have "fixed" backside culling for transparent faces. It used to be (V2.0.4) that when you used transparency math in a material, bzflag displayed all sides of the object, including backfaces. This led to a framerate reduction which became exponentially worse the more objects were transparent. .. But when you used a transparent texture bzflag didn't know it was transparent and culled faces properly, leading to faster FPS.
Now face culling is done the same way with a color math or with a texture. So there is no FPS boost either way. I think this was fixed in 2.0.6.
~devs++