diff --git a/Assets/backbox.hlsl b/Assets/backbox.hlsl index 5faf170..021edfd 100644 --- a/Assets/backbox.hlsl +++ b/Assets/backbox.hlsl @@ -2,13 +2,8 @@ //--name = dofdev/backbox //--color:color = 1, 1, 1, 1 -//--tex_scale = 1 -//--diffuse = white float4 color; -float tex_scale; -Texture2D diffuse : register(t0); -SamplerState diffuse_s : register(s0); struct vsIn { float4 pos : SV_Position; @@ -42,19 +37,17 @@ psIn vs(vsIn input, uint id : SV_InstanceID) { // flip input normals to treat backfaces like normal o.normal = normalize(mul(-input.norm, (float3x3)sk_inst[id].world)); - o.uv = input.uv * tex_scale; + o.uv = input.uv; o.color = color * sk_inst[id].color; return o; } float4 ps(psIn input) : SV_TARGET { - float4 col = diffuse.Sample(diffuse_s, input.uv); - float3 view_dir = normalize(input.world_pos - input.cam_pos); // Fresnel effect calculation float fresnel = 1.0 - saturate(dot(-view_dir, input.normal)); fresnel = pow(fresnel, 5.0); // Adjust power for different falloff rates float value = 0.5; - return lerp(col, float4(1), 0.666) * float4(fresnel * input.color.rgb * value, input.color.a); + return float4(fresnel * input.color.rgb * value, input.color.a); } \ No newline at end of file diff --git a/Assets/mono.hlsl b/Assets/mono.hlsl index 13eb797..b731cca 100644 --- a/Assets/mono.hlsl +++ b/Assets/mono.hlsl @@ -2,13 +2,8 @@ //--name = dofdev/mono //--color:color = 1, 1, 1, 1 -//--tex_scale = 1 -//--diffuse = white float4 color; -float tex_scale; -Texture2D diffuse : register(t0); -SamplerState diffuse_s : register(s0); struct vsIn { float4 pos : SV_Position; @@ -33,16 +28,12 @@ psIn vs(vsIn input, uint id : SV_InstanceID) { float3 normal = normalize(mul(input.norm, (float3x3)sk_inst[id].world)); - o.uv = input.uv * tex_scale; + o.uv = input.uv; float3 norm_color = float3(0.5) + (normal * 0.5); float3 norm_shade = float3(0.5) + (norm_color * 0.5); o.color = float4(norm_shade, 1) * input.col; // input.col * color * sk_inst[id].color; return o; } float4 ps(psIn input) : SV_TARGET { - float4 col = diffuse.Sample(diffuse_s, input.uv); - - col = col * input.color; - - return col; + return input.color; } \ No newline at end of file diff --git a/Assets/unlit.hlsl b/Assets/unlit.hlsl index 19e294f..e7969cc 100644 --- a/Assets/unlit.hlsl +++ b/Assets/unlit.hlsl @@ -2,13 +2,8 @@ //--name = dofdev/unlit //--color:color = 1, 1, 1, 1 -//--tex_scale = 1 -//--diffuse = white float4 color; -float tex_scale; -Texture2D diffuse : register(t0); -SamplerState diffuse_s : register(s0); struct vsIn { float4 pos : SV_Position; @@ -33,14 +28,10 @@ psIn vs(vsIn input, uint id : SV_InstanceID) { float3 normal = normalize(mul(input.norm, (float3x3)sk_inst[id].world)); - o.uv = input.uv * tex_scale; + o.uv = input.uv; o.color = input.col * color * sk_inst[id].color; return o; } float4 ps(psIn input) : SV_TARGET { - float4 col = diffuse.Sample(diffuse_s, input.uv); - - col = lerp(col, float4(1), 0.666) * input.color; - - return col; + return input.color; } \ No newline at end of file diff --git a/src/Arts.cs b/src/Arts.cs index e497851..273e36d 100644 --- a/src/Arts.cs +++ b/src/Arts.cs @@ -14,8 +14,6 @@ static class Arts static Material mat_backbox = new Material("backbox.hlsl"); static Material mat_justcolor = new Material("justcolor.hlsl"); - static Tex tex_box = Tex.FromFile("paper.jpg"); - public static Vec3 box_shake = new(0, 0, 0); static Quat food_ori = Quat.Identity; @@ -42,10 +40,6 @@ static class Arts Color.White ); - // mat_mono.SetTexture("diffuse", tex_mono); - mat_box.SetTexture("diffuse", tex_box); - mat_backbox.SetTexture("diffuse", tex_box); - mat_backbox.FaceCull = Cull.Front; mat_backbox.Transparency = Transparency.Add; mat_backbox.DepthTest = DepthTest.LessOrEq;