浏览代码

Fix compil issue with Ontile and FPTL

/main
sebastienlagarde 7 年前
当前提交
c5845945
共有 2 个文件被更改,包括 55 次插入0 次删除
  1. 28
      TestbedPipelines/Fptl/StandardTest.shader
  2. 27
      TestbedPipelines/OnTileDeferredPipeline/Shaders/OnTileCommon.hlsl

28
TestbedPipelines/Fptl/StandardTest.shader


CGINCLUDE
#define UNITY_SETUP_BRDF_INPUT MetallicSetup
#define CUBEMAPFACE_POSITIVE_X 0
#define CUBEMAPFACE_NEGATIVE_X 1
#define CUBEMAPFACE_POSITIVE_Y 2
#define CUBEMAPFACE_NEGATIVE_Y 3
#define CUBEMAPFACE_POSITIVE_Z 4
#define CUBEMAPFACE_NEGATIVE_Z 5
float CubeMapFaceID(float3 dir)
{
float faceID;
if (abs(dir.z) >= abs(dir.x) && abs(dir.z) >= abs(dir.y))
{
faceID = (dir.z < 0.0) ? CUBEMAPFACE_NEGATIVE_Z : CUBEMAPFACE_POSITIVE_Z;
}
else if (abs(dir.y) >= abs(dir.x))
{
faceID = (dir.y < 0.0) ? CUBEMAPFACE_NEGATIVE_Y : CUBEMAPFACE_POSITIVE_Y;
}
else
{
faceID = (dir.x < 0.0) ? CUBEMAPFACE_NEGATIVE_X : CUBEMAPFACE_POSITIVE_X;
}
return faceID;
}
ENDCG
SubShader

27
TestbedPipelines/OnTileDeferredPipeline/Shaders/OnTileCommon.hlsl


#endif // SHADER_API_MOBILE
#endif // #ifndef real
#define CUBEMAPFACE_POSITIVE_X 0
#define CUBEMAPFACE_NEGATIVE_X 1
#define CUBEMAPFACE_POSITIVE_Y 2
#define CUBEMAPFACE_NEGATIVE_Y 3
#define CUBEMAPFACE_POSITIVE_Z 4
#define CUBEMAPFACE_NEGATIVE_Z 5
float CubeMapFaceID(float3 dir)
{
float faceID;
if (abs(dir.z) >= abs(dir.x) && abs(dir.z) >= abs(dir.y))
{
faceID = (dir.z < 0.0) ? CUBEMAPFACE_NEGATIVE_Z : CUBEMAPFACE_POSITIVE_Z;
}
else if (abs(dir.y) >= abs(dir.x))
{
faceID = (dir.y < 0.0) ? CUBEMAPFACE_NEGATIVE_Y : CUBEMAPFACE_POSITIVE_Y;
}
else
{
faceID = (dir.x < 0.0) ? CUBEMAPFACE_NEGATIVE_X : CUBEMAPFACE_POSITIVE_X;
}
return faceID;
}
正在加载...
取消
保存