zoukankan      html  css  js  c++  java
  • uv计算

    lightmap

    shadowmap

    heightmap

    它们有一个自己的camera 对应cameraMatrix

    float3 TransfromToTextureCoord(float4 PositionWS, float4x4 CameraMatirx, float CameraOrthographicSize)
    {
    float3 heightUV;
    float4 posVS = mul(CameraMatirx, PositionWS);
    heightUV.x = posVS.x / CameraOrthographicSize;
    heightUV.y = posVS.y / CameraOrthographicSize;
    heightUV.z = posVS.z;
    heightUV.x = clamp((1 + heightUV.x) * 0.5, 0.0, 1.0);
    heightUV.y = clamp((heightUV.y + 1) * 0.5, 0.0, 1.0);
    return heightUV;
    }

    采样这张map的uv

    worldspace中那个posWS---viewSpace(生成时的camera的matrix)出现在那张rt里的位置映射到0-1

  • 相关阅读:
    Oracle Golden Gate
    DNS
    RMAN 管理
    黄伟-RAC生产库现场调整本分策略实战
    Linux下RAID技术
    OCP之黄伟 2
    About NULL Value
    OCP之黄伟
    Table
    Perl的简单变量
  • 原文地址:https://www.cnblogs.com/minggoddess/p/8882755.html
Copyright © 2011-2022 走看看