Program matrix -> GLSL Matrix

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

Program matrix -> GLSL Matrix

Worker
Hello

For simulation's i use in my code gl.glLoadMatrixd.
(A matrix with double's, that holds also very big
distances)
E.g. simulating the distances in the solarsytem
1:1 are to big for normal float's.
Now i have the problem, that all matrices in shaders
works only with simple floats.Is there another solution?
   
Reply | Threaded
Open this post in threaded view
|

Re: Program matrix -> GLSL Matrix

Demoscene Passivist
Administrator
There is an extension for double precision floating point math in GLSL: "GL_ARB_gpu_shader_fp64". If ur GPU supports it u can use doubles on nearly all datatypes. Try if this test program works and u can give it a shot.

Other than that I would recommend using JOCL for high-precision math
Reply | Threaded
Open this post in threaded view
|

Re: Program matrix -> GLSL Matrix

Worker
This post was updated on .
Thanks,

I know, jogl is the sole java 3d library that can handle double's.
The others that i have tested (e.g. lwgl) can handle only
floats for compatibility with old graphic cards.
I think the most GPU's today can handle doubles.

What i have seen is , that opengl from version 3.2 and GLSL 1.5 supports that.
But where i can call it, is this another type instead mat4 now mat4d or so????


(For others, i have wrote my own math library for an independent solution,
and if there is an interest here i can post it. It handles also quaternions.)

 
Reply | Threaded
Open this post in threaded view
|

Re: Program matrix -> GLSL Matrix

Sven Gothel
Administrator
On Tuesday, May 17, 2011 05:54:12 pm Worker [via jogamp] wrote:

>
> Thanks,
>
> I know, jogl is the sole java 3d library that can handle double's.
> The others that i have tested (e.g. lwgl) can handle only
> floats for compatibility with old graphic cards.
> I think the most GPU's today can handle doubles.
>
> Where i can found the extension for 'double precision floating point's' for
> shaders?
>
> For others, i have wrote my own math library for an independent solution.
>

current JOGL should have the fp64 extension supported
even though I haven't tested it yet.

usually it 'just' adds the 'double' type for uniforms/attributes etc.

Would be sweet, if you add a unit test and maybe a 64bit version of PMVMatrix,
maybe PMVMatrixFp64 ?

~Sven
Reply | Threaded
Open this post in threaded view
|

Re: Program matrix -> GLSL Matrix

Worker
I have reviewed opengl versions on www.opengl.org.
(See also his quick reference cards)
Double matrizes and vectors can used only from opengl version 4.0.
Seems i need a new graphic card:-(
My ends with version 3.3  
Reply | Threaded
Open this post in threaded view
|

Re: Program matrix -> GLSL Matrix

Sven Gothel
Administrator
On Wednesday, May 18, 2011 11:20:08 pm Worker [via jogamp] wrote:
>
> I have reviewed opengl versions on www.opengl.org.
> (See also his quick reference cards)
> Double matrizes can used only from opengl version 4.0.

dmat .. yup ..

> Seems i need a new graphic card:-(
> My ends with version 3.3  

Well ..

~Sven