|
From: Chris F. <ch...@ij...> - 2012-07-24 22:41:35
|
> Somewhat inversely, I'm also wondering if a simple texture1D() lookup might not be faster than evaluating the light function e / pow((1.0 + a * exp(-b * (x-c)) ),(1.0/d)) three times to get an (rgb)-triplet. That depends a lot on the GPU, and how coherent the texture coordinates are across a triangle. You also need enough ALU work elsewhere in the shader to mask the latency of the texture lookup. For the existing noise texture generation, take a look at make3DNoiseImage in scene/material/TextureBuilder.cxx in the simgear tree. This particular texture is filled CPU-side, but if you're more comfortable expressing things in a shader, you/someone could rig up some FBO wiring to quickly render a shader-defined function into a texture. -- Chris |