[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Dynamic loops and gl_FragDepth access in fragment shader



2012/1/22 Markus Schütz <markus_schuetz@gmx.at>:
> Are there any plans to enable dynamic loops in fragment Shaders?
> For example: I'd like to pass the amount of lights and an array with light
> data to the shader and iterate through all of them.
Dynamic looping often has quite a performance impact (and some devices
like mobiles can't do it at all), which is why often the driver
unrolls any kind of loop and executes it fully if it can.

> I'd also like to set the gl_FragDepth value because:
> - I have multi pass shaders that generate a depth map and an image in 2
> different fbos. The last pass draws the image into the system fbo but I also
> need to override the system fbo depth buffer with the values in the depth
> map.
This is a useful capability in circumstances where raycasting,
raytracing, path-tracing, paralax-mapping, signed distance fields,
impostors etc. are involved and rendered together with rasterized
geometry.
This OpenGL ES extension covers that functionality:
http://www.khronos.org/registry/gles/extensions/EXT/EXT_frag_depth.txt
hence it could be ported to WebGL.
I don't know how support for mobiles for this extension is.

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------