vertex colours again
Posted: Wed Feb 23, 2005 12:49 pm
hi, im writing a terrain algorithm, and now im trying to assing a color to the vertices according to their relative height.
i've put the VES_DIFFUSE information in my vertexbuffers.
the vertexcolours didnt get activated however.
so i began searching the forums for this issue.
i've found that you need to disable lighting for your material.
i do this with
mMaterial->setLightingEnabled(false);
and then i use eg. phong shading.
mMaterial->setShadingMode(SO_PHONG);
now the vertexcolours get activated, but the mesh isnt shaded.
(it's one big blob of the same colour)
is there anyway to make this work?
(is it because i disabled the lighting in my code, and not in a material script?)
help greatly appreciated.
Jelle
thx!
i've put the VES_DIFFUSE information in my vertexbuffers.
the vertexcolours didnt get activated however.
so i began searching the forums for this issue.
i've found that you need to disable lighting for your material.
i do this with
mMaterial->setLightingEnabled(false);
and then i use eg. phong shading.
mMaterial->setShadingMode(SO_PHONG);
now the vertexcolours get activated, but the mesh isnt shaded.
(it's one big blob of the same colour)
is there anyway to make this work?
(is it because i disabled the lighting in my code, and not in a material script?)
help greatly appreciated.
Jelle
thx!