Hide Show the tris of a surface of a skinned mesh

Blitz3D Forums/Blitz3D Beginners Area/Hide Show the tris of a surface of a skinned mesh

RemiD(Posted 2012) [#1]
Hello, :)

I am thinking about ways to hide or show the tris of a surface of a rigged and skinned mesh. (by rigged and skinned mesh, i mean a mesh having several joints and each vertex being influenced by one or two joints, and animations of these joints)

I want to be able to do this because for my glow routine, i do 2 renders, one for the glowing meshes and the non glowing meshes colored in black, and one for the non glowing meshes colored with their original colors.

So there is no need to render the glowing meshes twice, and considering there are many of them in my game, i want to avoid that.



For all non skinned meshes this is easy because i can separate the glowing parts and the non glowing parts in 2 meshes and then use HideEntity() or ShowEntity()

But for skinned meshes i can't do that... I guess i have to work with surfaces.



For now i have thought about these possible solutions :

1)Add one more joint per mesh and make each vertex of the glowing surface child of the joint.
Then i can retrieve the joint in Blitz3d and hide or show the joint, and it should (in theory) hide or show the children (the vertices).
I am not sure this will work for skinned meshes because usually a vertex can be influenced by one or two joints so...

2)Apparently EntityAlpha(Mesh,0) hides the tris, so maybe i can create a brush with alpha 0 and paint the surface with this brush to hide the surface.
Then paint the surface with the brush with the original colors to show the surface.

3)After having loaded the animated mesh in Blitz3d, i can retrieve and store the surfaces pointers.
With the surface pointer of the glowing parts i can retrieve the vertices of the surface and set their VertexAlpha to 0 to Hide the surface, or to 1 to show the surface.

My goal is not to hide the tris of the surface, but to disable the calculations for the rendering of this surface.

I have also read on the forum that it is possible to hide some vertices of a mesh simply by moving them behing the camera, why not, this may be doable with solution 1 or 3


What would you do to achieve this result ?

Thanks for your suggestions,

Last edited 2012


Matty(Posted 2012) [#2]
Can you have a texture with alpha transparency and apply it on a higher layer with multiply blending so that the glowing parts of the mesh are transparent?


RemiD(Posted 2012) [#3]
Thanks for the suggestion Matty, but what i want is :

My goal is not to hide the tris of the surface, but to disable the calculations for the rendering of this surface.



Also i don't want to use textures, only several groups + vertex colors or several surfaces + brushes. But thanks anyway.

I think that the best way is to move the vertices of the surface to hide out of the camera range. From what i have read on some forum posts, it seems this technique is also used to hide/show some tris when using a single surface particles system.


Kryzon(Posted 2012) [#4]
I remember someone mentioning that if you position all 3 vertices of a triangle at the same exact 3D coordinates, it culls the triangle - this on the hardware-side.

EDIT: Just realized this might not work for ya, since you're dealing with skinned animations and need to preserve the vertices' positions.

Last edited 2012