Pixel Shader example for jogl wanted...

I need an example pixel shader implementation for jogl(or ogl in c or c++).

It needs to use gl_fragment_program, since I want it to run on old machines with old graphics cards.

Any fullscreen effect shaders should be ok, 2xsai,antialias,eagle <- things like that. Bloom would be nice too.

Please help, I really wanna see shaders come into my jogl game.

Do you want the code to setup and use pixel shaders, or the actual shader code written in Cg, glsl, etc. (or older varieties since you wanted gl_fragment_program)?

Oh sorry, maybe I wasnt clear. What I need is the code to set up and use a pixel shader, possibly accompanied with some random shader to test it with. :slight_smile: Thanks

something like this?
https://netbeans-opengl-pack.dev.java.net/source/browse/netbeans-opengl-pack/trunk/jogl-utils/src/com/mbien/engine/glsl/GLSLShader.java?rev=476&view=markup
https://netbeans-opengl-pack.dev.java.net/source/browse/netbeans-opengl-pack/trunk/jogl-utils/src/com/mbien/engine/glsl/GLSLProgram.java?rev=476&view=markup

btw, the opengl pack ships with an GLSL shader editor (but no glsl samples yet… but you now… on the TODO list)

Yes something like that. I would really like something with a main-method, so I could test it and see that it is actually what I need. It seems a bit tricky because I have no experience in this field and am new to OpenGL. Also, I am looking for somethin fast/easy, so if someone can implement one of those in some test example, or show me some runnable example, it would be nice :slight_smile:

where in the opengl pack can this glsl editor be found? i looked through the examples and demos, but couldnt find it. thanks!

you already installed the pack, right? In this case you don’t have to to anything special to use the GLSL editor just open a shader file in the same way you would open a java or xml file. (there are also shader templates available if you want to create a new file for fragment, vertex and geometry shaders).

sidenote:
the JOGL project webstart support only works for NB 6.0 and 6.1. Next version of the pack will be NB 6.5 compatible but we will probably drop 6.1 and 6.0 support.

the shader designer tool from opengl.org looks very cool

i am also like to see how to implement the

envmap.vert & envmap.frag files for example to an simple

netbeans/opengl/jogl sample to see and learn

in the netbeans plugins there are the jogl shader examples
but in a very complicate structure

ok thanks! now when i have the file open in netbeans, how do i get to that editor?

or maybe this is a misunderstanding? what exactly is meant by “editor”? i was thinking of something like an interactive shader builder like nvidia’s fxcomposer?

This is on the TODO list (for quite some time…), but right now it’s just a syntax colorizing, error checking text editor with code completion.

  • code folding, navigator and compiler integration (e.g for error annotations) in other words an “editor” but not yet a designer ;D

if you are looking for some sample shaders this might help:
http://www.3dshaders.com/home/

rendermonkey and the “ShaderDesigner” (I think this one is no more under active development) have also several examples.