1

this does't work and everything turns black : (this is the vs)

#version 330

layout (location=0) in vec3 pos;
layout (location=1) in vec2 tex;
layout (location=2) in int lighting;

out vec2 texCoord;
out float color;

uniform mat4 cam_mat;

void main() {

    float light = float(lighting);
    color = (1.0f - (light / 3.0f)) / 2.0 + .5f;

however this does work :

layout (location=2) in float lighting;

when I make it into a float it does work and everything is fine

latter I would like to pack all the info into a single integer and casting that int to a float is pivotal to reducing the amount of vram i use <- I'm making a voxel game engine

Also I tried making an array of floats and using the int as an index but that didn't work either! ( I used some if statements and it seems all the ints I give it : {0, 1, 2, 3} goto : {0, >3, >3, >3} (>3 means the number was greater than 3 )) so wtf is happening?

1 Answers1

3

wait solved:

glVertexAttribIPointer(2, 1, GL_INT, 0, 0);