several meshes with the same texture = same surfac

Blitz3D Forums/Blitz3D Beginners Area/several meshes with the same texture = same surfac

RemiD(Posted 2013) [#1]
Hello,

Do you know if i have a scene with several meshes having one surface with the same properties (color, alpha, shininess, fx, blend), and textured with the same texture, is it as if there was only one surface in the scene or several surfaces ?

Thanks,


Yasha(Posted 2013) [#2]
Whether the surface is shared depends on how you created them.

- if you created each one with CreateMesh and CreateSurface, then no.
- if you created them with CopyMesh, then no.
- if you created them with LoadMesh, then you should assume not (but the engine might cache them behind the scenes if it feels like it)
- if you created them with CopyEntity, then yes.

So you should always use CopyEntity if you actually need the surface to be shared.


As for properties - they have no effect on sharing. There are two kinds of properties: entity, and surface. Both the entity and the surface have a brush, for instance; the surface brush is used (and, if painted, will change) across all meshes using the surface, while the entity brush is blended with it at rendertime on a per-entity basis. The other entity effects are similar - they are applied to the surface on top of the shared surface's own effects. Textures applied with EntityTexture are entity-level; textures applied with PaintSurface are surface-level and shared across all entities that share the surface.

Regardless of what level a property exists on, simply changing one - paint, shininess, texture - will never change whether a surface is shared or not. You always have manual control of this.


RemiD(Posted 2013) [#3]
Ok i see. So i will have to create only one mesh with one surface and use a big texture.

Thanks,