Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Commit

Permalink
Update ParralaxAlphav1.shader
Browse files Browse the repository at this point in the history
  • Loading branch information
Xlinka authored Sep 5, 2023
1 parent 518473a commit 011bcca
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions NEOSPlus/Shaders/ParralaxAlphav1.shader
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,19 @@ Shader "Custom/ParallaxOcclusionAlphaCutout" {
_AlphaCutoff("Alpha Cutoff", Range(0,1)) = 0.5
}
SubShader{
Tags { "RenderType" = "Opaque" }
Tags { "RenderType" = "TransparentCutout" }
LOD 200

CGPROGRAM
#pragma surface surf Lambert

#pragma surface surf Standard fullforwardshadows vertex:vert
#pragma target 3.0
sampler2D _MainTex;
sampler2D _BumpMap;
sampler2D _ParallaxMap;

struct Input {
float2 texcoord;
float3 eye;
float sampleRatio;
};

half _Glossiness;
half _Metallic;
half _BumpScale;
Expand Down Expand Up @@ -134,15 +131,11 @@ Shader "Custom/ParallaxOcclusionAlphaCutout" {
OUT.texcoord = IN.texcoord;
}

void surf(Input IN, inout SurfaceOutput o) {
float2 offset = parallax_offset(_Parallax, IN.eye, IN.sampleRatio, IN.texcoord * _TextureScale,
_ParallaxMap, _ParallaxMinSamples, _ParallaxMaxSamples);
void surf(Input IN, inout SurfaceOutputStandard o) {
float2 offset = parallax_offset(_Parallax, IN.eye, IN.sampleRatio, IN.texcoord * _TextureScale, _ParallaxMap, _ParallaxMinSamples, _ParallaxMaxSamples);
float2 uv = IN.texcoord * _TextureScale + offset;
fixed4 c = tex2D(_MainTex, uv) * _Color;

// Apply alpha cutoff
clip(c.a - _AlphaCutoff);

o.Albedo = c.rgb;
o.Normal = UnpackScaleNormal(tex2D(_BumpMap, uv), _BumpScale);
o.Metallic = _Metallic;
Expand Down

0 comments on commit 011bcca

Please sign in to comment.