Advantages of several surfaces vs several meshes ?

Blitz3D Forums/Blitz3D Beginners Area/Advantages of several surfaces vs several meshes ?

RemiD(Posted 2013) [#1]
Hello,

What are the advantages and disadvantages of several surfaces vs several meshes ?

I ask this because i want to add cubemapping to some surfaces of a mesh, but i have not found a way to decrease the reflection effect when using the color texture and the reflection texture on the same brush.
A possible way to decrease the reflection effect would be to duplicate the surface or the mesh which will have reflection and use these 2 surfaces or 2 meshes, one with the color texture and one with the reflection texture with an alpha smaller than 1.0.

But it seems easier to load 2 seperate meshes than to have to make 2 seperate surfaces. Especially if the surface with the reflection texture needs to be scaled slighlty more than the surface with the color texture.

Your thoughts ?

Thanks,


Yasha(Posted 2013) [#2]
Unless you use hundreds or more (at which point the weight of all those surfaces will have already started to slow down rendering significantly), there's no real difference. In machine terms, a mesh is just a wrapper around surfaces that lets you manipulate it as an entity. Weighs in at around half a KB, I think, which is nothing really.

If you need to use entity properties (like scale, position and so forth) then use the mesh option; that's what it was designed for. It will certainly be more efficient than trying to roll your own surface-scaling routines.


RemiD(Posted 2013) [#3]
Yasha>>Thanks for your explanations, i think i will try one more time to duplicate and scale a surface (my first try is a failure, i don't know how to create the tris wit the vertices in the right order but i have an idea how to do it), and if i fail again i will use several meshes.

Ok!


Charrua(Posted 2013) [#4]
try to imagine some thing like the right hand rule, in this way all tris will face te correct direction, wich you culd flip with flipmesh

http://en.wikipedia.org/wiki/Right-hand_rule

or if you have a mesh (loaded) scan it with some for loops (surfaces, tris, verts) and sotore that information, then you can manually create a copy, or save this info to disk... (probably in a b3d format...) depending on the future use


RemiD(Posted 2013) [#5]
I have manage to duplicate a surface and to scale it slightly more than its previous size but now i have z-ordering problems...

So i will try to use 2 separate surfaces, one for the non reflective parts and one for the reflective parts, and to use 1 diffuse texture for the non reflective parts and 1 diffuse texture + 1 grey texture + 1 cube mapping texture for the reflective parts in order to decrease the brightness of the reflection.
Apparently for small objects, to use a slightly bigger surface or a slightly bigger mesh with alpha will cause z-ordering problems.

And to change the CameraRange does not seem to resolve the issue for small objects.

Last edited 2013


RemiD(Posted 2013) [#6]
Just to let you know that i have managed to have the render i wanted this way :
For each surface which is non reflective, i use a brush with a Diffuse Texture with the color of the material.
For each surface which is reflective, i use a brush with a Diffuse Texture with the color of the material + a cubemapping texture.
The cubemapping texture is at layer 0 with a TextureBlend 1
The Diffuse texture is at layer 1 with a TextureBlend 2
I may add a grey texture in order to decrease or increase the brightness of the reflection.

The BrushColor is always 255,255,255 whatever the material.
The BrushBlend is always 1 whatever the material.
The BrushAlpha can change depending on if i want an opaque surface or a semi transparent surface
The BrushFx can change (normal or fullbright) depending on if i want to use the surface with my glow routine or not.

No need to duplicate some surfaces in others surfaces or others meshes. No more z-ordering problems. Done !


RemiD(Posted 2013) [#7]
removed useless post and code (off topic)


RemiD(Posted 2016) [#8]
One solution to decrease the brightness of the cubemap texture, that i have read on these forums (mentioned by jfk) is to use a quad colored in black and with a variable transparency and put it in front of the camera before capturing the scene from the point of view of the reflective object. This way the captured cubemap texture will be more or less bright/dark.

Good idea.