-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remake shaders using shader graph, add masked blend mode
- Loading branch information
1 parent
b1a89e2
commit ed4c5cf
Showing
11 changed files
with
361 additions
and
141 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// THIS FILE IS AUTO-GENERATED | ||
|
||
Layer0 | ||
{ | ||
shader "shaders/voxels_opaque.shader" | ||
|
||
//---- Texture Filtering ---- | ||
F_TEXTURE_FILTERING 3 // Point Sample | ||
|
||
Texture "materials/lights/white_color.tga" | ||
|
||
//---- Fog ---- | ||
g_bFogEnabled "1" | ||
|
||
DynamicParams | ||
{ | ||
Texture "color" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// THIS FILE IS AUTO-GENERATED | ||
|
||
Layer0 | ||
{ | ||
shader "shaders/voxels_translucent.shader" | ||
|
||
//---- Texture Filtering ---- | ||
F_TEXTURE_FILTERING 3 // Point Sample | ||
|
||
Texture "materials/default/default_color.tga" | ||
|
||
//---- Fog ---- | ||
g_bFogEnabled "1" | ||
|
||
//---- Translucent ---- | ||
g_flOpacityScale "1.000" | ||
|
||
DynamicParams | ||
{ | ||
Texture "color" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
|
||
HEADER | ||
{ | ||
Description = ""; | ||
} | ||
|
||
FEATURES | ||
{ | ||
#include "common/features.hlsl" | ||
} | ||
|
||
MODES | ||
{ | ||
VrForward(); | ||
Depth(); | ||
ToolsVis( S_MODE_TOOLS_VIS ); | ||
ToolsWireframe( "vr_tools_wireframe.shader" ); | ||
ToolsShadingComplexity( "tools_shading_complexity.shader" ); | ||
} | ||
|
||
COMMON | ||
{ | ||
#ifndef S_ALPHA_TEST | ||
#define S_ALPHA_TEST 0 | ||
#endif | ||
#ifndef S_TRANSLUCENT | ||
#define S_TRANSLUCENT 0 | ||
#endif | ||
|
||
#include "common/shared.hlsl" | ||
#include "procedural.hlsl" | ||
|
||
#define S_UV2 1 | ||
#define CUSTOM_MATERIAL_INPUTS | ||
} | ||
|
||
struct VertexInput | ||
{ | ||
#include "common/vertexinput.hlsl" | ||
float4 vColor : COLOR0 < Semantic( Color ); >; | ||
}; | ||
|
||
struct PixelInput | ||
{ | ||
#include "common/pixelinput.hlsl" | ||
float3 vPositionOs : TEXCOORD14; | ||
float3 vNormalOs : TEXCOORD15; | ||
float4 vTangentUOs_flTangentVSign : TANGENT < Semantic( TangentU_SignV ); >; | ||
float4 vColor : COLOR0; | ||
}; | ||
|
||
VS | ||
{ | ||
#include "common/vertex.hlsl" | ||
|
||
PixelInput MainVs( VertexInput v ) | ||
{ | ||
PixelInput i = ProcessVertex( v ); | ||
i.vPositionOs = v.vPositionOs.xyz; | ||
i.vColor = v.vColor; | ||
|
||
VS_DecodeObjectSpaceNormalAndTangent( v, i.vNormalOs, i.vTangentUOs_flTangentVSign ); | ||
|
||
return FinalizeVertex( i ); | ||
} | ||
} | ||
|
||
PS | ||
{ | ||
#include "common/pixel.hlsl" | ||
|
||
SamplerState g_sSampler0 < Filter( POINT ); AddressU( CLAMP ); AddressV( CLAMP ); >; | ||
CreateInputTexture2D( Texture, Srgb, 8, "None", "_color", ",0/,0/0", Default4( 1.00, 1.00, 1.00, 1.00 ) ); | ||
Texture2D g_tTexture < Channel( RGBA, Box( Texture ), Srgb ); OutputFormat( DXT5 ); SrgbRead( True ); >; | ||
|
||
float4 MainPs( PixelInput i ) : SV_Target0 | ||
{ | ||
Material m = Material::Init(); | ||
m.Albedo = float3( 1, 1, 1 ); | ||
m.Normal = float3( 0, 0, 1 ); | ||
m.Roughness = 1; | ||
m.Metalness = 0; | ||
m.AmbientOcclusion = 1; | ||
m.TintMask = 1; | ||
m.Opacity = 1; | ||
m.Emission = float3( 0, 0, 0 ); | ||
m.Transmission = 0; | ||
|
||
float4 l_0 = Tex2DS( g_tTexture, g_sSampler0, i.vTextureCoords.xy ); | ||
|
||
m.Albedo = l_0.xyz; | ||
m.Opacity = 1; | ||
m.Roughness = 1; | ||
m.Metalness = 0; | ||
m.AmbientOcclusion = 1; | ||
|
||
m.AmbientOcclusion = saturate( m.AmbientOcclusion ); | ||
m.Roughness = saturate( m.Roughness ); | ||
m.Metalness = saturate( m.Metalness ); | ||
m.Opacity = saturate( m.Opacity ); | ||
|
||
// Result node takes normal as tangent space, convert it to world space now | ||
m.Normal = TransformNormal( m.Normal, i.vNormalWs, i.vTangentUWs, i.vTangentVWs ); | ||
|
||
// for some toolvis shit | ||
m.WorldTangentU = i.vTangentUWs; | ||
m.WorldTangentV = i.vTangentVWs; | ||
m.TextureCoords = i.vTextureCoords.xy; | ||
|
||
return ShadingModelStandard::Shade( i, m ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"Model": "models/dev/plane.vmdl", | ||
"Description": "", | ||
"BlendMode": "Opaque", | ||
"nodes": [ | ||
{ | ||
"_class": "Result", | ||
"DefaultOpacity": 1, | ||
"DefaultRoughness": 1, | ||
"DefaultMetalness": 0, | ||
"DefaultAmbientOcclusion": 1, | ||
"Identifier": "0", | ||
"Position": "592,-96", | ||
"Albedo": { | ||
"Identifier": "1", | ||
"Output": "Result" | ||
} | ||
}, | ||
{ | ||
"_class": "TextureSampler", | ||
"Image": "materials/lights/white_color.tga", | ||
"Sampler": { | ||
"Filter": "Point", | ||
"AddressU": "Clamp", | ||
"AddressV": "Clamp" | ||
}, | ||
"UI": { | ||
"Name": "Texture", | ||
"Default": "1,1,1,1", | ||
"SrgbRead": true, | ||
"PrimaryGroup": { | ||
"Name": "" | ||
}, | ||
"SecondaryGroup": { | ||
"Name": "" | ||
}, | ||
"CreateInput": "CreateInputTexture2D" | ||
}, | ||
"Identifier": "1", | ||
"Position": "352,-96" | ||
} | ||
] | ||
} |
Oops, something went wrong.