Pherael
Member
|
Flat shading for dynamic created mesh
As in topic, in game I'm creating dynamic roof, but I don't know how change shading from smooth to flat. No matter what I try it's look like on screen.
Is there any in engine way, or only option is calculate them myself? (And since I'm not sure how, maybe somebody can help me with this?)
|
|
01-23-2017 10:59 AM |
|
Esenthel
Administrator
|
RE: Flat shading for dynamic created mesh
You could try 2 things:
1) remove mesh vtx normals manually in code, and work with material ambient light, or SetHighlight function
or
2) use "Blend" shader (not "Blend Light"), and just set the material color
I think #2 is simpler
|
|
01-24-2017 05:27 AM |
|
Tottel
Member
|
RE: Flat shading for dynamic created mesh
Can't you just properly set the normals for each unique rooftile?
|
|
01-24-2017 10:33 AM |
|
Esenthel
Administrator
|
RE: Flat shading for dynamic created mesh
Yes, this is option 3)
MeshBase mesh;
mesh.exclude(VTX_DUP);
mesh.explodeVtxs();
mesh.setNormals();
if having Mesh mesh;
then do first:
mesh.setBase();
MeshBase &base=mesh.parts[i].base;
base.... (as above)
mesh.setRender();
mesh.delBase();
|
|
01-24-2017 11:59 AM |
|
Pherael
Member
|
RE: Flat shading for dynamic created mesh
Thanks for help it seems that explodeVtxs() is what I needed.
|
|
01-24-2017 12:09 PM |
|