Skip to content

Commit

Permalink
Add missing shader file
Browse files Browse the repository at this point in the history
  • Loading branch information
cohaereo committed Jun 25, 2024
1 parent 2ebe367 commit d4bc304
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ received some polish!
- Decorator rendering (grass, plants, small rocks, etc.)
- Transform gizmo
- Compile-time shader compilation
- Post processing effects
- Post processing framework
- Ambient occlusion
- ~~Bloom~~ (TODO)
- ~~Color grading (WIP, currently set manually)~~ (TODO)
- Settings panel
- Fullscreen mode (can be enabled through `--fullscreen` argument or alt+enter)
- Hide the cursor when moving the camera
Expand Down
42 changes: 42 additions & 0 deletions crates/alkahest-renderer/assets/shaders/debug/custom.hlsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#include "scopes/view.hlsli"

cbuffer DebugShapeOptions : register(b0) {
float4x4 local_to_world;
float4 color;
}

struct VSOutput {
float4 position : SV_POSITION;
// float3 normal : NORMAL;
};

// Texture2D Matcap : register(t8);
// SamplerState SampleType : register(s0);
//
// float2 MatcapUV(float3 eye, float3 normal) {
// float2 muv = normal.xy * 0.5 + 0.5;
// return float2(muv.x, 1.0 - muv.y);
// }

VSOutput VSMain(
float3 position : POSITION,
float3 normal : NORMAL
) {

VSOutput output;

output.position = mul(world_to_projective, mul(local_to_world, float4(position, 1.0)));
// output.normal = normalize(mul(float4(normal, 0.0), (float3x3)local_to_world));

return output;
}

// Pixel Shader
float4 PSMain(VSOutput input) : SV_Target {
// float3 normal = normalize(input.normal.xyz);
// float3 eye = normalize(camera_forward.xyz);

// float3 matcap = Matcap.SampleLevel(SampleType, MatcapUV(eye, normal), 0).rgb;
// return float4(matcap * color, color.a);
return color;
}

0 comments on commit d4bc304

Please sign in to comment.