Mercurial > hg > forks > gldragon
diff dmmodel.h @ 32:1215fdd0a8ab
Add support for specifying specular and shininess values per model.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 22 Nov 2019 22:57:14 +0200 |
parents | 2403030a0352 |
children | d640f2a34031 |
line wrap: on
line diff
--- a/dmmodel.h Fri Nov 22 19:53:55 2019 +0200 +++ b/dmmodel.h Fri Nov 22 22:57:14 2019 +0200 @@ -121,12 +121,6 @@ }; -struct DMColor -{ - int r, g, b, alpha; -}; - - struct DMVector3 { float x, y, z; @@ -146,7 +140,8 @@ std::vector<DMVector3> vertices, normals; std::vector<unsigned int> faces; - DMColor color; + DMVector4 ambient, diffuse, specular; + int shininess; DMVector3 translate, scale, rotate; unsigned int id_prog, id_fs, id_vs; @@ -178,6 +173,9 @@ translate.x = translate.y = translate.z = 0; rotate.x = rotate.y = rotate.z = 0; scale.x = scale.y = scale.z = 1; + + specular.p.x = specular.p.y = specular.p.z = 0.8f; specular.p.w = 1.0f; + shininess = 96; } };