I draw thousands of colored quads by using the Quadstrip and Quads functionality.The vertices and colors are stored in vbo buffers and it works well and fast.

I use blending to just create a let me say a brightness effect

glBlendFunc(GL.GL_SRC_ALPHA,GL.GL_ZERO) this works also well.

Now I want to adapt the alpha range to the lowest and highest value of my received alpha valueto spread the alpha range exactly to my maximum ranges.

normally :alpha 0my lowest value 0,234my highest value 0,822alpha 1

I need:alpha 0 mapped to 0,234alpha 1 mapped to 0,822

Has anybody an idea how I can solve this so that the change affect directly the drawing of my stored quads in the vbo´s .Is there a OGL functionality available or is a shader a solution (I never wrote one )Thanks for your answers

Thank you for the answer ..A good information that a fragment shader can solve the problem.I have to read a little bit more about shader programming, at the moment I did not unstand your codebecause of less knowledge.I use jogl to acces the OGL interface and I will look for examples

Is it possible to set new values from my program on the cpu during the shaders is working ?

You can also change the high and low uniforms into constants if you don't need to be able to set them at runtime, which would make the Java code to setup the shader a little bit simpler. Well, Danny02 put it pretty well, but that's a newer GLSL version which is a bit harder for beginners.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org