Re: Custom Raster
Posted by
Xerxes Rånby on
Feb 18, 2014; 10:04am
URL: https://forum.jogamp.org/Custom-Raster-tp4031610p4031619.html
JeanPhi wrote
...
If I fail to intercept raster updates, then I will have to copy the buffer, which will be twice the work.
How and where are rasters identified in JOGL?
Remember the aim of JOGL is to allow Java application to access the GPU using hardware accelerated API's such as OpenGL. OpenGL Rasterization is done by code running inside the GPU thus its not possible to intercept GPU raster updates using java code running on the CPU.
Take a look at this diagram:
https://www.opengl.org/wiki/Rendering_Pipeline_Overviewthe programmer primes the OpenGL pipeline by providing the blue boxes (JOGL provides Java bindings to do this)
the GPU and its driver perform the yellow boxes running in parallel without interference from the CPU. (rasterization is done here by the GPU, JOGL simply wait for the GPU to complete, there is no API in JOGL or OpenGL to mess with the GPU while it do its work)
the end result is stored in the white boxes.. (JOGL provide Java API's to get the framebuffer etc)
http://www.youtube.com/watch?v=-P28LKWTzrI - Mythbusters Demo GPU versus CPU
Thus you do not want to intercept the rasterization using a CPU because the rasterization is best done in parallel using the GPU.
Ideally you want OpenGL to paint directly using the right destination thus no copy shall be needed after rasterization.