Fragment shaders

  • Follow


Hi!

How much per-vertex data can I pass to the vertex/fragment shader from 
OpenGL application?

More precisely: I'm displaying images with changable brightness/contrast 
which I want to realise using fragment shaders. Additionally, I want to 
change texture's pallette on the flight (I cannot use OpenGL's standard 
pallette mechanisms, because image is very large (~4kx3k px) and I cannot 
afford to load it frequently from buffer to texture) One solution is to pass 
pallette into shader, but luckily pallettes can be evaluated procedurally 
inside shader, so I haven't to share that data. However, possibly more image 
parameters will be passed, and I want to know the upper limit :)

Best regards -- Spook. 


0
Reply Wojciech 6/26/2009 6:53:04 AM

> How much per-vertex data can I pass to the vertex/fragment shader from
> OpenGL application?

It's implementation dependent and can be queried using glGet
(glGetIntegerv):

vertex shader:
GL_MAX_VERTEX_UNIFORM_COMPONENTS (in float units)
GL_MAX_VERTEX_ATTRIBS (in attributes)

fragment shader:
GL_MAX_FRAGMENT_UNIFORM_COMPONENTS (in float units)
GL_MAX_VARYING FLOATS (in float units)

- Tom
0
Reply Tom 6/26/2009 7:45:00 AM


Tom Burger wrote:
>> How much per-vertex data can I pass to the vertex/fragment shader
>> from OpenGL application?
>
> It's implementation dependent and can be queried using glGet
> (glGetIntegerv):
>
> vertex shader:
> GL_MAX_VERTEX_UNIFORM_COMPONENTS (in float units)
> GL_MAX_VERTEX_ATTRIBS (in attributes)
>
> fragment shader:
> GL_MAX_FRAGMENT_UNIFORM_COMPONENTS (in float units)
> GL_MAX_VARYING FLOATS (in float units)

Thanks for quick reply!

Do you know, if the OpenGL specification state, what is the minimum value 
for each element?

> - Tom

Best regards -- Spook. 


0
Reply Wojciech 6/26/2009 9:06:04 AM

> Do you know, if the OpenGL specification state, what is the minimum value
> for each element?

vertex shader:
GL_MAX_VERTEX_UNIFORM_COMPONENTS - 512 floats
GL_MAX_VERTEX_ATTRIBS - 16 attributes

fragment shader:
GL_MAX_FRAGMENT_UNIFORM_COMPONENTS - 64 floats
GL_MAX_VARYING FLOATS - 32 floats

- Tom
0
Reply Tom 6/26/2009 1:37:57 PM

Uzytkownik "Tom Burger" <t.burger@mimicmedia.nl> napisal w wiadomosci 
news:600f81ab-dac3-4f44-aa6b-cd86ceff8fa8@q37g2000vbi.googlegroups.com...
>> Do you know, if the OpenGL specification state, what is the minimum value
>> for each element?
>
> vertex shader:
> GL_MAX_VERTEX_UNIFORM_COMPONENTS - 512 floats
> GL_MAX_VERTEX_ATTRIBS - 16 attributes
>
> fragment shader:
> GL_MAX_FRAGMENT_UNIFORM_COMPONENTS - 64 floats
> GL_MAX_VARYING FLOATS - 32 floats

Thank you very much :)

> - Tom

Best regards -- Spook.

-- 
! ._______. Warning: Lucida Console sig!    //)    !
! || spk ||    www.spook.freshsite.pl      / _ """*!
! ||_____||        spook at op.pl         / '  | ""!
! |  ___  |   tlen: spoko_ws gg:1290136  /. __/"\ '!
! |_|[]_|_|  May the SOURCE be with you! \/)     \ ! 

0
Reply Wojciech 6/26/2009 9:49:22 PM

4 Replies
120 Views

(page loaded in 0.116 seconds)

Similiar Articles:













7/21/2012 12:03:59 AM


Reply: