Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  A few questions on gl shaders  (Read 887 times)
0 Members and 2 Guests are viewing this topic.
Offline lhkbob

JGO Neuromancer
****

Posts: 1174
Medals: 35



« on: 2007-04-24 17:02:50 »

First question:
If you have installed a fragment shader, must you also supply a vertex shader or will you still be able to use openGL's fixed functionality for that portion of the pipeline?
Second question:
If you are using matrix palette's and vertex blending, but then switch to a vertex shader, must you calculate the final vertex yourself from the weights and palette or will open gl still do that for you?

Offline Ken Russell

JGO Kernel
*****

Posts: 3446
Medals: 3


Java games rock!


« Reply #1 on: 2007-04-25 02:20:17 »

First question:
If you have installed a fragment shader, must you also supply a vertex shader or will you still be able to use openGL's fixed functionality for that portion of the pipeline?

You can still use the OpenGL fixed function pipeline for the vertex transformation portion.

Second question:
If you are using matrix palette's and vertex blending, but then switch to a vertex shader, must you calculate the final vertex yourself from the weights and palette or will open gl still do that for you?

This I don't know for sure but I strongly suspect you would have to calculate the final vertex yourself. However you should be able to find examples of matrix palette skinning in GLSL; check out either the OpenGL SDK or NVidia's SDK.
Offline operator

JGO n00b
*

Posts: 40



« Reply #2 on: 2007-04-25 02:27:56 »

if you are mixing shaders and ffp remember using

gl_Position = ftransform();

instead of

gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

to gain transform invariance. otherwise you will get artefacts...
Games published by our own members! Go get 'em!
Offline lhkbob

JGO Neuromancer
****

Posts: 1174
Medals: 35



« Reply #3 on: 2007-04-25 10:55:09 »

gl_Position = ftransform();

instead of

gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

I will keep this in mind, but what is the exact technical difference between the two?

Offline Chris61182

Full Member
**

Posts: 168



« Reply #4 on: 2007-04-28 01:46:43 »

I will keep this in mind, but what is the exact technical difference between the two?

There actually shouldn't be any difference on most shader capable GPUs since they no longer physically implement the fixed function pipeline.
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.073 seconds with 20 queries.