RootDynasty wrote:
IF YOU KNOW HOW TO USE OPENGL SHADERS PLEASE HELP OUT
The most important thing is to get the rendering to be done in color. The shader in the Glescraft tutorial takes a texture. The shader also uses a clever trick to shade the cubes by using negative texture coordinates. The code needs to be modified so that the color information is received along with the vertex information. I have spent many hours trying to get this to work with no luck.
These might help (GLSL 1.20, which you should support at the very least):
Code: Select allvarying vec3 pt_vec, pt_norm;
void main(void)
{
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;
pt_vec = gl_Vertex.xyz;
pt_norm = gl_Normal.xyz;
gl_FrontColor = gl_Color;
gl_TexCoord[0] = gl_MultiTexCoord0;
}
Code: Select allvarying vec3 pt_vec, pt_norm;
uniform vec3 sun; // directional light; does NOT compensate for occlusion!
const float ambient = 0.1;
const float diffuse = 1.0-ambient;
void main(void)
{
float dl = max(0.0,dot(-sun, pt_norm));
gl_FragColor = (ambient + diffuse*dl) * gl_Color;
}
Note, this does not do specular refraction. To do that, consider using Phong shading for point lights, and Blinn-Phong shading for directional lights.
This only handles one directional light (the sun).
RootDynasty wrote:Re-write another VXL loader
Personally I'd just load VXL in its raw form - it's quite raycaster-friendly, allows you to do at least some stuff more quickly than a raw format, and saves wasting 64MB of your not-so-precious-nowadays RAM. Just be wary that a lot of naïve stuff (hell, even VOXED does this) tends to spew runs which don't have a top part (S = E-1), but might have a bottom part (some don't, though).
I know Pyspades uses raw voxel data (as opposed to VXL). For Iceball though, I do have vxl<->raw conversion going on for block placement/removal, and even for the bunch-of-blocks-breaking code (which uses A* with a minimisation heuristic of -y, y being the positive vertical direction in my case, and broke those buildings in that screenshot in i think 0.4 seconds).
RootDynasty wrote:Add physics/collision detection
I suggest using fixed-point ints of reasonably good precision (16:16 is plenty). Floats can screw you over. Which reminds me, I need to split my physics routines up into quotient/remainder in Iceball, as you tend to fall through the floor every now and then. (The "jump up into the blocks" bug is due to autoclimb being a wee bit broken.)
That's all I can really say for now.