Some shit i dunno

This commit is contained in:
raccoon
2024-12-17 06:28:48 +05:00
parent 91f0193a63
commit aa0b1b6c8a
10 changed files with 13905 additions and 81 deletions

View File

@@ -60,28 +60,12 @@ Shader "Custom/InteriorReflectionShader"
fixed4 frag (v2f i) : SV_Target
{
float3 worldViewDir = normalize(i.worldPos);
float3 worldNormal = normalize(i.worldNormal);
float3 worldRefl = normalize(reflect(-worldViewDir, worldNormal));
float3 scale = ((worldRefl > 0 ? unity_SpecCube0_BoxMax.xyz : unity_SpecCube0_BoxMin.xyz) - i.worldPos) / worldRefl;
float scaleMin = min(min(scale.x, scale.y), scale.z);
float3 uvw = worldRefl * scaleMin + (i.worldPos - unity_SpecCube0_ProbePosition.xyz);
// float4 sampleRefl = SAMPLE_TEXTURECUBE_LOD(unity_SpecCube0, samplerunity_SpecCube0, uvw, LOD);
// float3 specCol = DecodeHDREnvironment(sampleRefl, unity_SpecCube0_HDR);
half4 sampleRefl = UNITY_SAMPLE_TEXCUBE(unity_SpecCube0, uvw);
half3 specCol = DecodeHDR(sampleRefl, unity_SpecCube0_HDR); // This is done becasue the cubemap is stored HDR
return half4(specCol, 1.0);
/*
half3 worldViewDir = normalize(UnityWorldSpaceViewDir(i.worldPos)); // Direction of ray from the camera towards the object surface
half3 reflection = reflect(-worldViewDir, i.worldNormal); // Direction of ray after hitting the surface of object
reflection = BoxProjectReflectionDir(i.worldPos, reflection);
half4 skyData = UNITY_SAMPLE_TEXCUBE(unity_SpecCube0, reflection);
half3 skyColor = DecodeHDR(skyData, unity_SpecCube0_HDR); // This is done becasue the cubemap is stored HDR
return half4(skyColor, 1.0);
*/
}
ENDCG
}