Looking for a shader example

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Looking for a shader example

Agnes
I am looking for a simple JOGL shader example that shows the essentials of pixel and vertex shading - for example, one triangle with shaders that simply copy the values from the geometry. Such an example must exist, but I can't find it... Can anyone help?
Reply | Threaded
Open this post in threaded view
|

Re: Looking for a shader example

Demoscene Passivist
Administrator
Maybe u should check out the turorial section in the jogamp wiki ? There are a couple of very basic setup tutorials that might fit ur description ...

For more advanced examples u may have a look at my blog @tumblr. It also features a very basic vertex shading example.

Hope this gets u started ... :)
Reply | Threaded
Open this post in threaded view
|

Re: Looking for a shader example

Sven Gothel
Administrator
On 06/19/2012 07:59 AM, Demoscene Passivist [via jogamp] wrote:

> Maybe u should check out the turorial section in the jogamp wiki
> <http://jogamp.org/wiki/index.php/Jogl_Tutorial> ? There are a couple of very
> basic setup tutorials that might fit ur description ...
>
> For more advanced examples u may have a look at my blog @tumblr.
> <http://copypastaresearch.tumblr.com/> It also features a very basic vertex
> shading example
> <http://copypastaresearch.tumblr.com/post/1033237190/ported-another-glsl-routine-to-jogl2-this-time-a>.
>
>
> Hope this gets u started ... :)
>
A very detailed and documented demo if from Xerxes here:

<http://jogamp.org/git/?p=jogl-demos.git;a=blob;f=src/demos/es2/RawGL2ES2demo.java;hb=HEAD>

And our junit tests and demos ofc:

<http://jogamp.org/git/?p=jogl.git;a=tree;f=src/test/com/jogamp/opengl/test/junit/jogl/glsl;hb=HEAD>

<http://jogamp.org/git/?p=jogl.git;a=tree;f=src/test/com/jogamp/opengl/test/junit/jogl/demos/es2;hb=HEAD>

~Sven


signature.asc (910 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Looking for a shader example

Xerxes Rånby
In reply to this post by Agnes
2012-06-19 06:55, Agnes [via jogamp] skrev:
I am looking for a simple JOGL shader example that shows the essentials of pixel and vertex shading - for example, one triangle with shaders that simply copy the values from the geometry. Such an example must exist, but I can't find it... Can anyone help?

Hi I created a really basic example, to help my own understanding, that displays a shaded triangle that you can try:
https://raw.github.com/xranby/jogl/master/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RawGL2ES2demo.java
   wget http://jogamp.org/deployment/jogamp-current/archive/jogamp-all-platforms.7z
   7z x jogamp-all-platforms.7z
   cd jogamp-all-platforms
   wget https://raw.github.com/xranby/jogl/master/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RawGL2ES2demo.java
   javac -cp jar/jogl.all.jar:jar/gluegen-rt.jar RawGL2ES2demo.java
   java -cp jar/jogl.all.jar:jar/gluegen-rt.jar:. RawGL2ES2demo

If you reply to this email, your message will be added to the discussion below:
http://forum.jogamp.org/Looking-for-a-shader-example-tp4025242.html
To start a new topic under jogamp, email [hidden email]
To unsubscribe from jogamp, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Looking for a shader example

Agnes
Thank you all for your help. The xranby example is perfect for me - both kinds of shader in one file, no IO or other fussiness.
Reply | Threaded
Open this post in threaded view
|

Re: Looking for a shader example

Agnes
I have the sample running on my machine. There was one small issue: the GLSL compiler complained that the "#version" instruction had to be the first statement in the file - it obviously counted the #ifdef as a statement.
Reply | Threaded
Open this post in threaded view
|

Re: Looking for a shader example

Chris
In reply to this post by Agnes
Take a look here,

it has all you need to get shaders up and working.

http://www.guyford.co.uk/showpage.php?id=50&page=How_to_setup_and_load_GLSL_Shaders_in_JOGL
Reply | Threaded
Open this post in threaded view
|

Re: Looking for a shader example

gouessej
Administrator
Chris wrote
Take a look here,

it has all you need to get shaders up and working.

http://www.guyford.co.uk/showpage.php?id=50&page=How_to_setup_and_load_GLSL_Shaders_in_JOGL
It is an example relying on an obsolete version of JOGL and I already told you once to avoid posting that kind of example to avoid confusing beginners. Moreover, it is not more useful than existing examples on the official repository, lots of checks are missing in yours.
Julien Gouesse | Personal blog | Website