Pressets.

This commit is contained in:
max
2021-03-31 01:20:21 +02:00
parent 1e21d42722
commit 12a4122134
9 changed files with 141 additions and 32 deletions

View File

@ -0,0 +1,34 @@
Shader "Hidden/Surface"
{
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Standard fullforwardshadows
// Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0
sampler2D _RS_Texture;
fixed4 _RS_Color;
half _RS_Metallic;
half _RS_Glossiness;
struct Input
{
float2 uv_RS_Texture;
};
void surf (Input IN, inout SurfaceOutputStandard o)
{
o.Albedo = tex2D(_RS_Texture, IN.uv_RS_Texture) * _RS_Color;
o.Metallic = _RS_Metallic;
o.Smoothness = _RS_Glossiness;
}
ENDCG
}
FallBack "Diffuse"
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 442bea547b43fe643959790eb5b87ede
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -29,7 +29,7 @@ Shader "Hidden/TriPlanarTexture"
sampler2D _RS_Texture;
float4 _RS_Texture_ST;
float _RS_Float;
float _RS_Sharpness;
v2f vert (appdata v)
{
@ -57,7 +57,7 @@ Shader "Hidden/TriPlanarTexture"
//show texture on both sides of the object (positive and negative)
weights = abs(weights);
//make the transition sharper
weights = pow(weights, _RS_Float);
weights = pow(weights, _RS_Sharpness);
//make it so the sum of all components is 1
weights = weights / (weights.x + weights.y + weights.z);