Texture + Vertex Lighting help
Blitz3D Forums/Blitz3D Programming/Texture + Vertex Lighting help
| ||
I'm trying to get baked vertex lighting as shadows + diffuse textures to show up on my mesh , unfortunately I can't find any topic specific to this issue or I guess it's buried somewhere. Any ideas? appreciate any help. |
| ||
Entityfx..... flag 2. Set the vertex colors. You may need to set them to zero first. |
| ||
or brushfx(brush,2) then paintsurface(surface,brush), if you want to affect only a surface of the mesh. |
| ||
Thanks Matty and RemiD, works perfectly! :D On the topic of Blitz surfaces, I'm not sure I can follow. Does this mean that I can texture a single face of a mesh? For starters, I would like to apply a texture to a cube (CreateCube) dynamically and a separate texture on the top or bottom. How do I do this? |
| ||
A mesh is made of one or several surfaces. A surface is made of several vertices and triangles A brush contains the properties to color a surface (color (rgb), transparency (alpha), how it must be affected by lights (fx), texture) So you could have several surfaces in your mesh and apply different colors/textures/lighting on each surface. |
| ||
Ok understood. So how do I go about applying a texture by code, is there an easy to understand demo on how brushes works? seems to be off-topic on my main question here so I hope it's ok if I can get some solution. thanks again |
| ||
Take a look at the Blitz3d docs : LoadTexture or CreateTexture() CreateBrush() BrushTexture() PaintSurface() FreeBrush() And of course you need different surfaces if you want to be able to apply different textures on the same mesh. |
| ||
Thanks RemiD, will look into this. |
| ||
Look at the samples that come with a skybox such as the castle or flying bird demos. There is a function makeskybox that does rxactly what you describe. |
| ||
Thanks Matty |