Re: GL slang draft

Philippe C.D. Robert <[email protected]> Sun, 2 Mar 2003 22:01:30 +0100
Newsgroups gmane.comp.gnu.3dkit.general
Message-ID <[email protected]>
On Thursday, February 27, 2003, at 08:49  Uhr, Brent Gulanowski wrote:
> This is disappointing:
>
>> Related OpenGL state is also automatically tracked if used by the 
>> shader. A fragment shader cannot
>> change a fragment's x/y position. To support parallelism at the 
>> fragment processing level, fragment
>> shaders are written in a way that expresses the computation required 
>> for a single fragment, and access to
>> neighboring fragments is not allowed. A fragment shader is free to 
>> read multiple values from a single
>> texture, or multiple values from multiple textures. The values 
>> computed by the fragment shader are
>> ultimately used to update frame-buffer memory or texture memory, 
>> depending on the current OpenGL
>> state and the OpenGL command that caused the fragments to be 
>> generated.
>
> If I understand that correctly, it means that you cannot simulate 
> things like aberrations in a lens or depth of field using the fragment 
> shader. (The latter I see in the OGL PG is to be done with the 
> accumulation buffer.) Or does it mean that you have to do some kind of 
> two-stage process?

z-buffer rendering is not ray tracing, but you an use the programmable 
shaders of a GPU to implement a ray tracer - or easier you use some 
nice tricks to achieve these results in OGL, as you mention already 
(this requires multipass rendering, yes).

> It seems to mean that the kinds of filters associated with photoshop, 
> like blurs, swirls, bleeds, and other such things are still not ready 
> for hardware acceleration. I was hoping that visualizers like for 
> iTunes and WinAmp would be able to move their work to the card, but it 
> seems unlikely.

You can achieve imaging operations in OGL using the ARB_imaging 
extensions, unfortunately they are not supported on all graphics cards 
(SGI machines support them, and maybe NVidia cards). You can also 
render to textures and then use shaders to implement such operations, 
for example.

-Phil
--
Philippe C.D. Robert
http://www.nice.ch/~phip