Home Technical Talk

shader question: staggering normals

polycounter lvl 18
Offline / Send Message
arshlevon polycounter lvl 18
i want to take the normal vector and offset it a bit by a random amount, probably by a noise texture. actually i want to do it a few times and composite the result, the result should look blurred.. anyone know the best way to go about this?

Replies

  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    An array of random vectors or a lookup texture could do. if you just want to blur you should use a Gaussian kernel or even just use a smaller mipmap.
  • arshlevon
    Offline / Send Message
    arshlevon polycounter lvl 18
    i cant just use Gaussian blur because apparently its too expensive, and i cant use a smaller mip because i need control over the amount of blur,the effect will be subtle so even the 1st mip will probably be too much.. and it would of been better to say stagger a vector because its not really just for normals..

    i think i am just going to go bug some engine dudes, they just always seem too busy to answer my questions.
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 20
    well there is not much you can do, brice told you the options. you can pass random vectors as texture or as uniform array... or you could use noise approximation and generte on the fly (quite costly so).

    you can experiment with offseting the texcoord prior to sampling the normalmap. although you will risk discontinuities on uv edges. but perturbation like that (similar to heat effect) can create illusion of "blur"

    regarding the mipmap, you can lerp between mipmap states and current state and mix a bit perpixelwise, no?

    play around with stuff!
    actually i want to do it a few times and composite the result
    what do you actually mean by this?
  • multivac
    You could use Poisson-disk blur,its a lot cheaper than gaussian and you can vary the patterns with different sample points.about 10 taps should be plenty.
    It would help if you could just tell us what effect you are trying to achieve:)
  • arshlevon
    Offline / Send Message
    arshlevon polycounter lvl 18
    yeah basically i am trying to do some SSS fake, i got decent result using light vectors before but we don't have light vectors any more with our new lighting.. i can access the luminance though so i wanted to blur the red channel of the luminance by a certain amount, the green channel by half that amount and the blue channel none, initial tests of this gave awesome results, but i was told blurring the channels was not the way to go, so i have been doing different tests on the normals and cube map to try and emulate this. i should have totally stated this up front, sorry about that.

    this is not something pressing, but i wanted to throw some ideas out there and possibly prototype something that is close. i am no tech artist, but i can hack stuff together for demonstration purposes, and basically thats all i am trying to do.


    thanks for all the help i will look into everything that has been stated...
Sign In or Register to comment.