Surface Shader input structure reference for the Built-In Render Pipeline
Reference for the input structure of a Surface Shader.
읽는 시간 1분최근 업데이트: 3일 전
The input structure generally has any texture coordinates needed by the shader. Texture coordinates must be named "" followed by texture name (or start it with "" to use second texture coordinate set).
Inputuvuv2Additional values that can be put into Input structure:
- - contains view direction, for computing Parallax effects, rim lighting etc.
float3 viewDir - with
float4semantic - contains interpolated per-vertex color.COLOR - - contains screen space position for reflection or screenspace effects. Note that this is not suitable for GrabPass; you need to compute custom UV yourself using
float4 screenPosfunction.ComputeGrabScreenPos - - contains world space position.
float3 worldPos - - contains world reflection vector if surface shader does not write to o.Normal. See Reflect-Diffuse shader for example.
float3 worldRefl - - contains world normal vector if surface shader does not write to o.Normal.
float3 worldNormal - - contains world reflection vector if surface shader writes to o.Normal. To get the reflection vector based on per-pixel normal map, use
float3 worldRefl; INTERNAL_DATA. See Reflect-Bumped shader for example.WorldReflectionVector (IN, o.Normal) - - contains world normal vector if surface shader writes to o.Normal. To get the normal vector based on per-pixel normal map, use
float3 worldNormal; INTERNAL_DATA.WorldNormalVector (IN, o.Normal)