Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Per-pixel attenuation problem.

  1. #11
    Intern Newbie
    Join Date
    Feb 2003
    Location
    Finland
    Posts
    37

    Re: Per-pixel attenuation problem.

    I think I actually computed the attenuation in the fragment shader, before I changed to the texture attenuation. And since if you have a texture of size 512x512 as an attenuation map, you can do 3d attenuation with just the one 2d texture. I think that's kind of handy and I actually need the accurate falloff, if I want to project shadow volumes to the light range. But I don't do that atm. so that's not a necessity. Btw. this has been bugging me for some time: does ATI have branching support in any extension for shaders/programs, since I can't find any :\ The ARB_vertex_program doesn't support them, and I haven't seen any in EXT_vertex_shader :\ I know that NV_vertex_program_x_x or what ever they're called ^_^ supports brancing, but ATI seems to support it only in D3D9 as predefined behaviour, that is non-dynamic. Or am I wrong, does ATI have support for brancing in some extension, have I missed it?

    Cheers!
    Hmm...

  2. #12
    Senior Member OpenGL Pro
    Join Date
    Feb 2001
    Location
    Switzerland
    Posts
    1,840

    Re: Per-pixel attenuation problem.

    hm.. i always use (1-dst^2/light_radius_squared)^2

    fast, simple, is 0 at dst = light_radius, and looks like exp(-dst^2/radius_squared), means like the gaussian approach for attentuation.. or so..

    looks pretty natural for being very simple. i actually developed it in two different ways individiually and got twice that equation, proof enough for me its the way to use

    difference to reality is negitible for the speed gain, espencially on low-end hw.
    http://davepermen.net - if i could stay true to my heart, i would feel totally free

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •