I've writen a program to give people seisures

http://members.optusnet.com.au/ksaho/krunosStupidBehaviour/seisure.jar

My first fragment program.
Damn this was so easy to do.

I think my brain is waking up this time of the year. I learnt how to use and create vertex and fragment programs within 15 minutes.
After I understood it, I’ve basically decided to use display lists in conjunction with shaders so I don’t have to depend on display lists to do all the fancy stuff, just to do basic framework. It also saves memory.

My only issue now is how would I pack JOGL files with my app and have my app rely on them?

Eh? Please elaborate…

Include nothing but the position of verices within the display list.
Colour manipulation and everything else is done through shaders.

Hm… I downloaded JOGL 'n stuff, gave your program a try, and well, it’s just a fullscene quad with random colors… bit disappointed here.

For everybody wondering what the shader code was:


void main(),
{
   gl_FragColor = gl_Color;
}

And your rendering-code:


gl.glUseProgramObjectARB(shaderProgram);
		
gl.glColor3f
(
	(float)Math.random(),
	(float)Math.random(),
	(float)Math.random()
);
gl.glCallList(triangle);

So…

[quote]Colour manipulation and everything else is done through shaders.
[/quote]
is not true. And yes, not including the color in the displaylist saves video-memory… maybe 6 bytes.

From a technical point it’s great that you found out how to use shaders. It took me a little longer than 15 minutes as LWJGL documentation was a bit outdated :slight_smile: So you can be proud of what you achieved, but the demo-app wasn’t really worth the try :stuck_out_tongue:

[quote]is not true.
[/quote]
How so? I thought GL Slang has access to variables such as gl_color which are built in?

If you want a vertex/fragment program that reimplements what the basic opengl rendering already does (per vertex lighting, multitexture support, alpha clipping, and fog… and possibly some more things I forgot about), it’s going to be quite a bit more work than just a color-passthrough fragment shader.

But good job getting started. =) Shader programs are fun.

Okay guys, sorry about that.

I’ve fixed my proggie and have a new link.

http://members.optusnet.com.au/ksaho/krunosStupidBehaviour/seisure.zip