// Pass world-space position to fragment shader
P = (gl_ModelViewMatrix * gl_Vertex).xyz;
}
Frag shader:
varying vec3 P;
void main()
{
// Store world-position in atlas texture
gl_FragColor = vec4(P, 1.0);
}
Then, for each pixel, to something like this:
foreach pixel:
addVoxelAtPosition(pixel.color);
Got it?
Man, I got it, thanks. But how can I use voxel data in program code? Do you read my question?
I asked about "c# structure class to store voxel data and be able for further using in code". Capish?