GLSL & Mental Mill

BlitzMax Forums/OpenGL Module/GLSL & Mental Mill

eindbaas(Posted 2007) [#1]
I want to experiment a little with GLSL in BlitzMax, and am currently playing with nvidia's mental mill to create some shaders. i can export those as GLSL, but i have no idea what to do with those. can i use them with bmax?


eindbaas(Posted 2007) [#2]
for example, this is the code that's generated. how do i use it in blitzmax?


uniform float flip_normal;

varying vec3 position;

void main()
{
	gl_Position = ftransform();
	position = (gl_ModelViewMatrix * gl_Vertex).xyz;

	if( flip_normal > 0.0 ) {
		gl_FrontColor = vec4(1.0);
		gl_BackColor  = vec4(0.0);
	} else {
		gl_FrontColor = vec4(0.0);
		gl_BackColor  = vec4(1.0);
	}
}



ImaginaryHuman(Posted 2007) [#3]
You have to look at using OpenGL extensions, ARB libraries and all that, to get access to the shader support.


Tom(Posted 2007) [#4]
Shaders were promoted from ARB status as of OpenGL 2.0 I think, i.e, they're standard GL functions now.

These are some great tutorials on GLSL
http://www.lighthouse3d.com/opengl/glsl/index.php?intro