Texture + Vertex Lighting help

Blitz3D Forums/Blitz3D Programming/Texture + Vertex Lighting help

RustyKristi(Posted 2015) [#1]
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.


Matty(Posted 2015) [#2]
Entityfx..... flag 2.
Set the vertex colors.
You may need to set them to zero first.


RemiD(Posted 2015) [#3]
or brushfx(brush,2) then paintsurface(surface,brush), if you want to affect only a surface of the mesh.


RustyKristi(Posted 2015) [#4]
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?


RemiD(Posted 2015) [#5]
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.


RustyKristi(Posted 2015) [#6]
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


RemiD(Posted 2015) [#7]
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.


RustyKristi(Posted 2015) [#8]
Thanks RemiD, will look into this.


Matty(Posted 2015) [#9]
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.


RustyKristi(Posted 2015) [#10]
Thanks Matty