update ModelBatch.box semantics
This commit is contained in:
@@ -41,7 +41,7 @@ class ModelBatch {
|
||||
uint32_t integer;
|
||||
} compressed;
|
||||
|
||||
compressed.integer = (static_cast<uint32_t>(light.r * 255) & 0xff) << 24;
|
||||
compressed.integer = (static_cast<uint32_t>(light.r * 255) & 0xff) << 24;
|
||||
compressed.integer |= (static_cast<uint32_t>(light.g * 255) & 0xff) << 16;
|
||||
compressed.integer |= (static_cast<uint32_t>(light.b * 255) & 0xff) << 8;
|
||||
compressed.integer |= (static_cast<uint32_t>(light.a * 255) & 0xff);
|
||||
@@ -49,12 +49,12 @@ class ModelBatch {
|
||||
buffer[index++] = compressed.floating;
|
||||
}
|
||||
|
||||
inline void plane(glm::vec3 pos, glm::vec3 right, glm::vec3 up, glm::vec3 norm, glm::vec4 light) {
|
||||
inline void plane(glm::vec3 pos, glm::vec3 right, glm::vec3 up, glm::vec3 norm, glm::vec4 lights) {
|
||||
norm = rotation * norm;
|
||||
float d = glm::dot(norm, SUN_VECTOR);
|
||||
d = 0.8f + d * 0.2f;
|
||||
|
||||
auto color = light * d;
|
||||
auto color = lights * d;
|
||||
|
||||
vertex(pos-right-up, {0,0}, color);
|
||||
vertex(pos+right-up, {1,0}, color);
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
void pushMatrix(glm::mat4 matrix);
|
||||
void popMatrix();
|
||||
|
||||
void box(glm::vec3 pos, glm::vec3 size);
|
||||
void box(glm::vec3 pos, glm::vec3 size, glm::vec4 lights);
|
||||
|
||||
void test(glm::vec3 pos, glm::vec3 size);
|
||||
void flush();
|
||||
|
||||
Reference in New Issue
Block a user