Projext/Assets/Dungeon_Environment/Shaders/MI_Bottle_01.shader
2026-02-22 22:37:34 +09:00

460 lines
19 KiB
GLSL

Shader "Unreal/MI_Bottle_01"
{
Properties
{
_MainTex("MainTex (RGB)", 2D) = "white" {}
Material_Texture2D_0( "N", 2D ) = "white" {}
Material_Texture2D_1( "BC", 2D ) = "white" {}
Material_Texture2D_2( "AO_R_MT", 2D ) = "white" {}
View_BufferSizeAndInvSize( "View_BufferSizeAndInvSize", Vector ) = ( 1920,1080,0.00052, 0.00092 )//1920,1080,1/1920, 1/1080
LocalObjectBoundsMin( "LocalObjectBoundsMin", Vector ) = ( 0, 0, 0, 0 )
LocalObjectBoundsMax( "LocalObjectBoundsMax", Vector ) = ( 100, 100, 100, 0 )
}
SubShader
{
Tags { "RenderType" = "Opaque" }
//BLEND_ON Tags { "RenderType" = "Transparent" "Queue" = "Transparent" }
//Blend SrcAlpha OneMinusSrcAlpha
//Cull Off
CGPROGRAM
#include "UnityPBSLighting.cginc"
#pragma surface surf Standard vertex:vert addshadow
//BLEND_ON #pragma surface surf Standard vertex:vert alpha:fade addshadow
#pragma target 5.0
#define NUM_TEX_COORD_INTERPOLATORS 1
#define NUM_MATERIAL_TEXCOORDS_VERTEX 1
#define NUM_CUSTOM_VERTEX_INTERPOLATORS 0
struct Input
{
//float3 Normal;
float2 uv_MainTex : TEXCOORD0;
float2 uv2_Material_Texture2D_0 : TEXCOORD1;
//float2 uv2_MainTex : TEXCOORD1;
float4 color : COLOR;
float4 tangent;
//float4 normal;
float3 viewDir;
float4 screenPos;
float3 worldPos;
//float3 worldNormal;
float3 normal2;
INTERNAL_DATA
};
void vert( inout appdata_full i, out Input o )
{
float3 p_normal = mul( float4( i.normal, 0.0f ), unity_WorldToObject );
//half4 p_tangent = mul( unity_ObjectToWorld,i.tangent );
//half3 normal_input = normalize( p_normal.xyz );
//half3 tangent_input = normalize( p_tangent.xyz );
//half3 binormal_input = cross( p_normal.xyz,tangent_input.xyz ) * i.tangent.w;
UNITY_INITIALIZE_OUTPUT( Input, o );
//o.worldNormal = p_normal;
o.normal2 = p_normal;
o.tangent = i.tangent;
//o.binormal_input = binormal_input;
}
uniform sampler2D _MainTex;
/*
struct SurfaceOutputStandard
{
fixed3 Albedo; // base (diffuse or specular) color
fixed3 Normal; // tangent space normal, if written
half3 Emission;
half Metallic; // 0=non-metal, 1=metal
// Smoothness is the user facing name, it should be perceptual smoothness but user should not have to deal with it.
// Everywhere in the code you meet smoothness it is perceptual smoothness
half Smoothness; // 0=rough, 1=smooth
half Occlusion; // occlusion (default 1)
fixed Alpha; // alpha for transparencies
};
*/
#define Texture2D sampler2D
#define TextureCube samplerCUBE
#define SamplerState int
//#define UE5
#define MATERIAL_TANGENTSPACENORMAL 1
//struct Material
//{
//samplers start
uniform sampler2D Material_Texture2D_0;
uniform SamplerState Material_Texture2D_0Sampler;
uniform sampler2D Material_Texture2D_1;
uniform SamplerState Material_Texture2D_1Sampler;
uniform sampler2D Material_Texture2D_2;
uniform SamplerState Material_Texture2D_2Sampler;
//};
#ifdef UE5
#define UE_LWC_RENDER_TILE_SIZE 2097152.0
#define UE_LWC_RENDER_TILE_SIZE_SQRT 1448.15466
#define UE_LWC_RENDER_TILE_SIZE_RSQRT 0.000690533954
#define UE_LWC_RENDER_TILE_SIZE_RCP 4.76837158e-07
#define UE_LWC_RENDER_TILE_SIZE_FMOD_PI 0.673652053
#define UE_LWC_RENDER_TILE_SIZE_FMOD_2PI 0.673652053
#define INVARIANT(X) X
#define PI (3.1415926535897932)
//#include "LargeWorldCoordinates.hlsl"
#endif
struct MaterialStruct
{
float4 VectorExpressions[2];
float4 ScalarExpressions[2];
float VTPackedPageTableUniform[2];
float VTPackedUniform[1];
};
struct ViewStruct
{
float GameTime;
float RealTime;
float DeltaTime;
float PrevFrameGameTime;
float PrevFrameRealTime;
float MaterialTextureMipBias;
SamplerState MaterialTextureBilinearWrapedSampler;
SamplerState MaterialTextureBilinearClampedSampler;
float4 PrimitiveSceneData[ 40 ];
float4 TemporalAAParams;
float2 ViewRectMin;
float4 ViewSizeAndInvSize;
float MaterialTextureDerivativeMultiply;
uint StateFrameIndexMod8;
float FrameNumber;
float2 FieldOfViewWideAngles;
float4 RuntimeVirtualTextureMipLevel;
float PreExposure;
float4 BufferBilinearUVMinMax;
};
struct ResolvedViewStruct
{
#ifdef UE5
FLWCVector3 WorldCameraOrigin;
FLWCVector3 PrevWorldCameraOrigin;
FLWCVector3 PreViewTranslation;
FLWCVector3 WorldViewOrigin;
#else
float3 WorldCameraOrigin;
float3 PrevWorldCameraOrigin;
float3 PreViewTranslation;
float3 WorldViewOrigin;
#endif
float4 ScreenPositionScaleBias;
float4x4 TranslatedWorldToView;
float4x4 TranslatedWorldToCameraView;
float4x4 TranslatedWorldToClip;
float4x4 ViewToTranslatedWorld;
float4x4 PrevViewToTranslatedWorld;
float4x4 CameraViewToTranslatedWorld;
float4 BufferBilinearUVMinMax;
float4 XRPassthroughCameraUVs[ 2 ];
};
struct PrimitiveStruct
{
float4x4 WorldToLocal;
float4x4 LocalToWorld;
};
ViewStruct View;
ResolvedViewStruct ResolvedView;
PrimitiveStruct Primitive;
uniform float4 View_BufferSizeAndInvSize;
uniform float4 LocalObjectBoundsMin;
uniform float4 LocalObjectBoundsMax;
uniform SamplerState Material_Wrap_WorldGroupSettings;
uniform SamplerState Material_Clamp_WorldGroupSettings;
#define PI UNITY_PI
#include "UnrealCommon.cginc"
MaterialStruct Material;
void InitializeExpressions()
{
Material.VectorExpressions[0] = float4(0.000000,0.000000,0.000000,0.000000);//SelectionColor
Material.VectorExpressions[1] = float4(0.000000,0.000000,0.000000,0.000000);//(Unknown)
Material.ScalarExpressions[0] = float4(0.000000,0.000000,1.000000,0.000000);//Flatness (S) (Unknown) Brightness Desaturation
Material.ScalarExpressions[1] = float4(1.000000,34.835636,0.000000,0.000000);//Metalness Roughness (Unknown) (Unknown)
}
float3 GetMaterialWorldPositionOffset(FMaterialVertexParameters Parameters)
{
#if USE_INSTANCING
// skip if this instance is hidden
if (Parameters.PerInstanceParams.z < 1.f)
{
return float3(0,0,0);
}
#endif
return MaterialFloat3(0.00000000,0.00000000,0.00000000);;
}
void CalcPixelMaterialInputs(in out FMaterialPixelParameters Parameters, in out FPixelMaterialInputs PixelMaterialInputs)
{
//WorldAligned texturing & others use normals & stuff that think Z is up
Parameters.TangentToWorld[0] = Parameters.TangentToWorld[0].xzy;
Parameters.TangentToWorld[1] = Parameters.TangentToWorld[1].xzy;
Parameters.TangentToWorld[2] = Parameters.TangentToWorld[2].xzy;
float3 WorldNormalCopy = Parameters.WorldNormal;
// Initial calculations (required for Normal)
MaterialFloat Local0 = MaterialStoreTexCoordScale(Parameters, Parameters.TexCoords[0].xy, 0);
MaterialFloat4 Local1 = UnpackNormalMap(Texture2DSampleBias(Material_Texture2D_0, Material_Texture2D_0Sampler,Parameters.TexCoords[0].xy,View.MaterialTextureMipBias));
MaterialFloat Local2 = MaterialStoreTexSample(Parameters, Local1, 0);
MaterialFloat3 Local3 = lerp(Local1.rgb,MaterialFloat3(0.00000000,0.00000000,1.00000000),MaterialFloat(Material.ScalarExpressions[0].x));
// The Normal is a special case as it might have its own expressions and also be used to calculate other inputs, so perform the assignment here
PixelMaterialInputs.Normal = Local3;
// Note that here MaterialNormal can be in world space or tangent space
float3 MaterialNormal = GetMaterialNormal(Parameters, PixelMaterialInputs);
#if MATERIAL_TANGENTSPACENORMAL
#if SIMPLE_FORWARD_SHADING
Parameters.WorldNormal = float3(0, 0, 1);
#endif
#if FEATURE_LEVEL >= FEATURE_LEVEL_SM4
// Mobile will rely on only the final normalize for performance
MaterialNormal = normalize(MaterialNormal);
#endif
// normalizing after the tangent space to world space conversion improves quality with sheared bases (UV layout to WS causes shrearing)
// use full precision normalize to avoid overflows
Parameters.WorldNormal = TransformTangentNormalToWorld(Parameters.TangentToWorld, MaterialNormal);
#else //MATERIAL_TANGENTSPACENORMAL
Parameters.WorldNormal = normalize(MaterialNormal);
#endif //MATERIAL_TANGENTSPACENORMAL
#if MATERIAL_TANGENTSPACENORMAL
// flip the normal for backfaces being rendered with a two-sided material
Parameters.WorldNormal *= Parameters.TwoSidedSign;
#endif
Parameters.ReflectionVector = ReflectionAboutCustomWorldNormal(Parameters, Parameters.WorldNormal, false);
#if !PARTICLE_SPRITE_FACTORY
Parameters.Particle.MotionBlurFade = 1.0f;
#endif // !PARTICLE_SPRITE_FACTORY
// Now the rest of the inputs
MaterialFloat3 Local4 = lerp(MaterialFloat3(0.00000000,0.00000000,0.00000000),Material.VectorExpressions[1].rgb,MaterialFloat(Material.ScalarExpressions[0].y));
MaterialFloat Local5 = MaterialStoreTexCoordScale(Parameters, Parameters.TexCoords[0].xy, 2);
MaterialFloat4 Local6 = ProcessMaterialColorTextureLookup(Texture2DSampleBias(Material_Texture2D_1, Material_Texture2D_1Sampler,Parameters.TexCoords[0].xy,View.MaterialTextureMipBias));
MaterialFloat Local7 = MaterialStoreTexSample(Parameters, Local6, 2);
MaterialFloat3 Local8 = (Local6.rgb * Material.ScalarExpressions[0].z);
MaterialFloat Local9 = dot(Local8, MaterialFloat3(0.30000001,0.58999997,0.11000000));
MaterialFloat3 Local10 = lerp(Local8,MaterialFloat3(Local9,Local9,Local9),MaterialFloat(Material.ScalarExpressions[0].w));
MaterialFloat Local11 = MaterialStoreTexCoordScale(Parameters, Parameters.TexCoords[0].xy, 1);
MaterialFloat4 Local12 = ProcessMaterialColorTextureLookup(Texture2DSampleBias(Material_Texture2D_2, Material_Texture2D_2Sampler,Parameters.TexCoords[0].xy,View.MaterialTextureMipBias));
MaterialFloat Local13 = MaterialStoreTexSample(Parameters, Local12, 1);
MaterialFloat Local14 = (Material.ScalarExpressions[1].x * Local12.b);
MaterialFloat Local15 = (Material.ScalarExpressions[1].y * Local12.g);
PixelMaterialInputs.EmissiveColor = Local4;
PixelMaterialInputs.Opacity = 1.00000000;
PixelMaterialInputs.OpacityMask = 1.00000000;
PixelMaterialInputs.BaseColor = Local10;
PixelMaterialInputs.Metallic = Local14;
PixelMaterialInputs.Specular = 0.50000000;
PixelMaterialInputs.Roughness = Local15;
PixelMaterialInputs.Anisotropy = 0.00000000;
PixelMaterialInputs.Tangent = MaterialFloat3(1.00000000,0.00000000,0.00000000);
PixelMaterialInputs.Subsurface = 0;
PixelMaterialInputs.AmbientOcclusion = Local12.r;
PixelMaterialInputs.Refraction = 0;
PixelMaterialInputs.PixelDepthOffset = 0.00000000;
PixelMaterialInputs.ShadingModel = 1;
#if MATERIAL_USES_ANISOTROPY
Parameters.WorldTangent = CalculateAnisotropyTangent(Parameters, PixelMaterialInputs);
#else
Parameters.WorldTangent = 0;
#endif
}
void surf( Input In, inout SurfaceOutputStandard o )
{
InitializeExpressions();
float3 Z3 = float3( 0, 0, 0 );
float4 Z4 = float4( 0, 0, 0, 0 );
float3 UnrealWorldPos = float3( In.worldPos.x, In.worldPos.y, In.worldPos.z );
float3 UnrealNormal = In.normal2;
FMaterialPixelParameters Parameters = (FMaterialPixelParameters)0;
#if NUM_TEX_COORD_INTERPOLATORS > 0
Parameters.TexCoords[ 0 ] = float2( In.uv_MainTex.x, 1.0 - In.uv_MainTex.y );
#endif
#if NUM_TEX_COORD_INTERPOLATORS > 1
Parameters.TexCoords[ 1 ] = float2( In.uv2_Material_Texture2D_0.x, 1.0 - In.uv2_Material_Texture2D_0.y );
#endif
#if NUM_TEX_COORD_INTERPOLATORS > 2
for( int i = 2; i < NUM_TEX_COORD_INTERPOLATORS; i++ )
{
Parameters.TexCoords[ i ] = float2( In.uv_MainTex.x, 1.0 - In.uv_MainTex.y );
}
#endif
Parameters.VertexColor = In.color;
Parameters.WorldNormal = UnrealNormal;
Parameters.ReflectionVector = half3( 0, 0, 1 );
Parameters.CameraVector = normalize( _WorldSpaceCameraPos.xyz - UnrealWorldPos.xyz );
//Parameters.CameraVector = mul( ( float3x3 )unity_CameraToWorld, float3( 0, 0, 1 ) ) * -1;
Parameters.LightVector = half3( 0, 0, 0 );
float4 screenpos = In.screenPos;
screenpos /= screenpos.w;
//screenpos.y = 1 - screenpos.y;
Parameters.SvPosition = float4( screenpos.x, screenpos.y, 0, 0 );
Parameters.ScreenPosition = Parameters.SvPosition;
Parameters.UnMirrored = 1;
Parameters.TwoSidedSign = 1;
float3 InWorldNormal = UnrealNormal;
float4 InTangent = In.tangent;
float4 tangentWorld = float4( UnityObjectToWorldDir( InTangent.xyz ), InTangent.w );
tangentWorld.xyz = normalize( tangentWorld.xyz );
float3x3 OriginalTangentToWorld = CreateTangentToWorldPerVertex( InWorldNormal, tangentWorld.xyz, tangentWorld.w );
Parameters.TangentToWorld = OriginalTangentToWorld;
//WorldAlignedTexturing in UE relies on the fact that coords there are 100x larger, prepare values for that
//but watch out for any computation that might get skewed as a side effect
UnrealWorldPos = ToUnrealPos( UnrealWorldPos );
Parameters.AbsoluteWorldPosition = UnrealWorldPos;
Parameters.WorldPosition_CamRelative = UnrealWorldPos;
Parameters.WorldPosition_NoOffsets = UnrealWorldPos;
Parameters.WorldPosition_NoOffsets_CamRelative = Parameters.WorldPosition_CamRelative;
Parameters.LightingPositionOffset = float3( 0, 0, 0 );
Parameters.AOMaterialMask = 0;
Parameters.Particle.RelativeTime = 0;
Parameters.Particle.MotionBlurFade;
Parameters.Particle.Random = 0;
Parameters.Particle.Velocity = half4( 1, 1, 1, 1 );
Parameters.Particle.Color = half4( 1, 1, 1, 1 );
Parameters.Particle.TranslatedWorldPositionAndSize = float4( UnrealWorldPos, 0 );
Parameters.Particle.MacroUV = half4(0,0,1,1);
Parameters.Particle.DynamicParameter = half4(0,0,0,0);
Parameters.Particle.LocalToWorld = float4x4( Z4, Z4, Z4, Z4 );
Parameters.Particle.Size = float2(1,1);
Parameters.Particle.SubUVCoords[ 0 ] = Parameters.Particle.SubUVCoords[ 1 ] = float2( 0, 0 );
Parameters.Particle.SubUVLerp = 0.0;
Parameters.TexCoordScalesParams = float2( 0, 0 );
Parameters.PrimitiveId = 0;
Parameters.VirtualTextureFeedback = 0;
FPixelMaterialInputs PixelMaterialInputs = ( FPixelMaterialInputs)0;
PixelMaterialInputs.Normal = float3( 0, 0, 1 );
PixelMaterialInputs.ShadingModel = 0;
PixelMaterialInputs.FrontMaterial = 0;
View.GameTime = View.RealTime = _Time.y;// _Time is (t/20, t, t*2, t*3)
View.PrevFrameGameTime = View.GameTime - unity_DeltaTime.x;//(dt, 1/dt, smoothDt, 1/smoothDt)
View.PrevFrameRealTime = View.RealTime;
View.DeltaTime = unity_DeltaTime.x;
View.MaterialTextureMipBias = 0.0;
View.TemporalAAParams = float4( 0, 0, 0, 0 );
View.ViewRectMin = float2( 0, 0 );
View.ViewSizeAndInvSize = View_BufferSizeAndInvSize;
View.MaterialTextureDerivativeMultiply = 1.0f;
View.StateFrameIndexMod8 = 0;
View.FrameNumber = (int)_Time.y;
View.FieldOfViewWideAngles = float2( PI * 0.42f, PI * 0.42f );//75degrees, default unity
View.RuntimeVirtualTextureMipLevel = float4( 0, 0, 0, 0 );
View.PreExposure = 0;
View.BufferBilinearUVMinMax = float4(
View_BufferSizeAndInvSize.z * ( 0 + 0.5 ),//EffectiveViewRect.Min.X
View_BufferSizeAndInvSize.w * ( 0 + 0.5 ),//EffectiveViewRect.Min.Y
View_BufferSizeAndInvSize.z * ( View_BufferSizeAndInvSize.x - 0.5 ),//EffectiveViewRect.Max.X
View_BufferSizeAndInvSize.w * ( View_BufferSizeAndInvSize.y - 0.5 ) );//EffectiveViewRect.Max.Y
for( int i2 = 0; i2 < 40; i2++ )
View.PrimitiveSceneData[ i2 ] = float4( 0, 0, 0, 0 );
float4x4 ViewMatrix = transpose( unity_MatrixV );
float4x4 InverseViewMatrix = transpose( unity_MatrixInvV );
float4x4 ViewProjectionMatrix = transpose( unity_MatrixVP );
uint PrimitiveBaseOffset = Parameters.PrimitiveId * PRIMITIVE_SCENE_DATA_STRIDE;
View.PrimitiveSceneData[ PrimitiveBaseOffset + 0 ] = unity_ObjectToWorld[ 0 ];//LocalToWorld
View.PrimitiveSceneData[ PrimitiveBaseOffset + 1 ] = unity_ObjectToWorld[ 1 ];//LocalToWorld
View.PrimitiveSceneData[ PrimitiveBaseOffset + 2 ] = unity_ObjectToWorld[ 2 ];//LocalToWorld
View.PrimitiveSceneData[ PrimitiveBaseOffset + 3 ] = unity_ObjectToWorld[ 3 ];//LocalToWorld
View.PrimitiveSceneData[ PrimitiveBaseOffset + 6 ] = unity_WorldToObject[ 0 ];//WorldToLocal
View.PrimitiveSceneData[ PrimitiveBaseOffset + 7 ] = unity_WorldToObject[ 1 ];//WorldToLocal
View.PrimitiveSceneData[ PrimitiveBaseOffset + 8 ] = unity_WorldToObject[ 2 ];//WorldToLocal
View.PrimitiveSceneData[ PrimitiveBaseOffset + 9 ] = unity_WorldToObject[ 3 ];//WorldToLocal
View.PrimitiveSceneData[ PrimitiveBaseOffset + 10 ] = unity_WorldToObject[ 0 ];//PreviousLocalToWorld
View.PrimitiveSceneData[ PrimitiveBaseOffset + 11 ] = unity_WorldToObject[ 1 ];//PreviousLocalToWorld
View.PrimitiveSceneData[ PrimitiveBaseOffset + 12 ] = unity_WorldToObject[ 2 ];//PreviousLocalToWorld
View.PrimitiveSceneData[ PrimitiveBaseOffset + 13 ] = unity_WorldToObject[ 3 ];//PreviousLocalToWorld
View.PrimitiveSceneData[ PrimitiveBaseOffset + 18 ] = float4( ToUnrealPos( UNITY_MATRIX_M[ 3 ] ), 0 );//ActorWorldPosition
View.PrimitiveSceneData[ PrimitiveBaseOffset + 19 ] = LocalObjectBoundsMax - LocalObjectBoundsMin;//ObjectBounds
View.PrimitiveSceneData[ PrimitiveBaseOffset + 21 ] = mul( unity_ObjectToWorld, float3( 1, 0, 0 ) );//ObjectOrientation
View.PrimitiveSceneData[ PrimitiveBaseOffset + 23 ] = LocalObjectBoundsMin;//LocalObjectBoundsMin
View.PrimitiveSceneData[ PrimitiveBaseOffset + 24 ] = LocalObjectBoundsMax;//LocalObjectBoundsMax
#ifdef UE5
ResolvedView.WorldCameraOrigin = LWCPromote( ToUnrealPos( _WorldSpaceCameraPos.xyz ) );
ResolvedView.PreViewTranslation = LWCPromote( float3( 0, 0, 0 ) );
ResolvedView.WorldViewOrigin = LWCPromote( float3( 0, 0, 0 ) );
#else
ResolvedView.WorldCameraOrigin = ToUnrealPos( _WorldSpaceCameraPos.xyz );
ResolvedView.PreViewTranslation = float3( 0, 0, 0 );
ResolvedView.WorldViewOrigin = float3( 0, 0, 0 );
#endif
ResolvedView.PrevWorldCameraOrigin = ResolvedView.WorldCameraOrigin;
ResolvedView.ScreenPositionScaleBias = float4( 1, 1, 0, 0 );
ResolvedView.TranslatedWorldToView = ViewMatrix;
ResolvedView.TranslatedWorldToCameraView = ViewMatrix;
ResolvedView.TranslatedWorldToClip = ViewProjectionMatrix;
ResolvedView.ViewToTranslatedWorld = InverseViewMatrix;
ResolvedView.PrevViewToTranslatedWorld = ResolvedView.ViewToTranslatedWorld;
ResolvedView.CameraViewToTranslatedWorld = InverseViewMatrix;
ResolvedView.BufferBilinearUVMinMax = View.BufferBilinearUVMinMax;
ResolvedView.XRPassthroughCameraUVs[ 0 ] = ResolvedView.XRPassthroughCameraUVs[ 1 ] = float4( 0, 0, 1, 1 );
Primitive.WorldToLocal = unity_WorldToObject;
Primitive.LocalToWorld = unity_ObjectToWorld;
CalcPixelMaterialInputs( Parameters, PixelMaterialInputs );
#define HAS_WORLDSPACE_NORMAL 0
#if HAS_WORLDSPACE_NORMAL
PixelMaterialInputs.Normal = mul( PixelMaterialInputs.Normal, (MaterialFloat3x3)( transpose( OriginalTangentToWorld ) ) );
#endif
o.Albedo = PixelMaterialInputs.BaseColor.rgb;
o.Alpha = PixelMaterialInputs.Opacity;
//if( PixelMaterialInputs.OpacityMask < 0.333 ) discard;
o.Metallic = PixelMaterialInputs.Metallic;
o.Smoothness = 1.0 - PixelMaterialInputs.Roughness;
o.Normal = normalize( PixelMaterialInputs.Normal );
o.Emission = PixelMaterialInputs.EmissiveColor.rgb;
o.Occlusion = PixelMaterialInputs.AmbientOcclusion;
//BLEND_ADDITIVE o.Alpha = ( o.Emission.r + o.Emission.g + o.Emission.b ) / 3;
}
ENDCG
}
Fallback "Diffuse"
}