Results 1 to 4 of 4

Thread: Rotate Env Map ?

  1. #1
    Join Date
    Mar 2011
    Posts
    3

    Exclamation Rotate Env Map ?

    Hi all...

    I try to create CgFX shader For using in Maya.

    I have to create simple reflections (cubemap) - but i can't rotate this EnvMap and Can't Offset it...

    Why i need this ? I just want to setup nice reflections right in viewport.

    Alsow i have plans use animated EnvMap rotation and Offset for illusion of motion...

    I need some help...
    For example, this is code from Environment Map Cubic:

    void main()
    {
    float3 v = transform_vector("internal", "world", direction);

    result = texCUBE(env_tex, v.xzy);
    result *= intensity;
    }

    What i can do for rotating this Cube, or Translating?
    I want to create Car Material CGFX - and i want reflection animated....
    This is the possible ?

    A lot of thanks for all opinions and answers....

  2. #2
    Join Date
    Mar 2011
    Posts
    3

    Default

    Ok. No way ?

    Ok who know solution about animated reflection maps in GLSL ?
    Map can be rotated, moved, or contain animated sequence - this possible ?

    i just need adjustable reflections for GLSL. Very interested to find solution for that.

  3. #3
    Join Date
    Jun 2007
    Location
    Berlin
    Posts
    447

    Default

    You can add rotation to the environment shader by modifying the MetaSL code of the shader. You can rotate the direction vector apropriately before feeding it to the texCUBE(...) function.
    You do this by setting up a 3x3 rotation matrix. You can find the details about creating rotation matrices for vectors on many pages on the web and in every good text book about computer graphics.

    When you talk about offsetting, I assume that you want the environment map to be in a non-infinite distance and to apply some texture animation to it, right?

    Best Regards,
    Ruediger

  4. #4
    Join Date
    Mar 2011
    Posts
    3

    Default

    Quote Originally Posted by ruediger View Post
    You can add rotation to the environment shader by modifying the MetaSL code of the shader. You can rotate the direction vector apropriately before feeding it to the texCUBE(...) function.
    You do this by setting up a 3x3 rotation matrix. You can find the details about creating rotation matrices for vectors on many pages on the web and in every good text book about computer graphics.
    thanks ruediger, i already try to insert the rotation code (but work in progress - something is wrong in my calculations.

    Quote Originally Posted by ruediger View Post
    When you talk about offsetting, I assume that you want the environment map to be in a non-infinite distance and to apply some texture animation to it, right?
    I mean something like independed texture coordinates offset on any side of Environment Cube. But i'm sure, i need to understand all details about - how envmap work...And then i can do what i want.

    ruediger - may be my answers looks strange, but in many many many production cases, we need to fine tune for reflections. For example - we need to find the Best position of reflected windows on the side of glass - best for the given camera, etc.) I try to use GLSL and realtime shaders in production tasks. Not serious now, but i really sure about soon as possible i will try to insert GLSL features to pipeline.

    Very Thanks for answer and for attention, ruediger, looks like you only still alive here)

Posting Permissions

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