Shader杂记---GLSL To Cg

1.替换iGlobalTime为_Time.y
2.替换iResolution.xy替换为_ScreenParams.xy
3.替换vec2为float2
4.替换mat2为float22
5.替换vec3(1)为float3(1,1,1)
6.替换Textrue2D为Tex2D
7.替换atan(x,y)为atan2(y,x)
8.替换mix()为lerp()
9.替换
为mul()
10.mainImage(out vec4 fragColor, in vec2 fragCoord) 相当于float4 mainImage(float2 fragCoord : SV_POSITION) : SV_Target
11.GLSL的uv是的y值从上到下为[0-1],HLSL为[1-0],所以uv.y=1-uv.y

你可能感兴趣的:(Shader杂谈,shader,unity)