no engine anymore
This commit is contained in:
0
funnyassets/gfx_shaders/mesh_raytracer_hit.slang
Normal file
0
funnyassets/gfx_shaders/mesh_raytracer_hit.slang
Normal file
0
funnyassets/gfx_shaders/mesh_raytracer_miss.slang
Normal file
0
funnyassets/gfx_shaders/mesh_raytracer_miss.slang
Normal file
16
funnyassets/gfx_shaders/mesh_raytracer_raygen.slang
Normal file
16
funnyassets/gfx_shaders/mesh_raytracer_raygen.slang
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
#include "mesh_raytracer_shared.slang"
|
||||
|
||||
[shader("raygeneration")]
|
||||
void _main()
|
||||
{
|
||||
uint2 launchIndex = DispatchRaysIndex().xy;
|
||||
uint8_t edgemask = inputMask.Load(uint3(launchIndex, 0));
|
||||
uint8_t edgemask1 = inputMask.Load(uint3(launchIndex, 1));
|
||||
uint8_t edgemask2 = inputMask.Load(uint3(launchIndex, 2));
|
||||
uint8_t edgemask3 = inputMask.Load(uint3(launchIndex, 3));
|
||||
uint8_t nBits = (countbits(edgemask) + countbits(edgemask1) + countbits(edgemask2) + countbits(edgemask3));
|
||||
if ( nBits != 16 && nBits != 0 )
|
||||
outputTest[launchIndex] = float4(1,0,0,0);
|
||||
|
||||
}
|
||||
18
funnyassets/gfx_shaders/mesh_raytracer_shared.slang
Normal file
18
funnyassets/gfx_shaders/mesh_raytracer_shared.slang
Normal file
@@ -0,0 +1,18 @@
|
||||
struct RayPayload
|
||||
{
|
||||
bool bHit;
|
||||
float fDistance;
|
||||
};
|
||||
|
||||
#include "shader_base.slang"
|
||||
|
||||
DECLARE_CBUFFER(0)
|
||||
{
|
||||
float4x4 projection;
|
||||
}
|
||||
|
||||
DECLARE_DATA(1, Texture2DMS<float> inputDepth;);
|
||||
DECLARE_DATA(2, Texture2DMS<uint8_t> inputMask;);
|
||||
DECLARE_DATA(3, RWTexture2D<float4> outputTest;);
|
||||
|
||||
DECLARE_TEXTURES(29)
|
||||
25
funnyassets/gfx_shaders/shader_base.slang
Normal file
25
funnyassets/gfx_shaders/shader_base.slang
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef SHADER_BASE_SLANG
|
||||
#define SHADER_BASE_SLANG
|
||||
|
||||
/*
|
||||
* I hope you are not looking at these war crimes.
|
||||
* They are truly horrible crimes.
|
||||
* Don't even try to understand what the fuck is happening here.
|
||||
*/
|
||||
#define DECLARE_TEXTURES(n) \
|
||||
[[vk::binding(n)]] \
|
||||
Sampler2D g_textures[]; \
|
||||
float4 SampleTexture(uint32_t binding, float2 uv) { return g_textures[binding].Sample(uv); };
|
||||
|
||||
#define DECLARE_CBUFFER(b) [[vk::binding(b)]] cbuffer cbuffer_##b
|
||||
|
||||
|
||||
#define DECLARE_DATA(b, r) [[vk::binding(b)]] r
|
||||
|
||||
#define DECLARE_CONSTANTS [[vk::push_constant]] cbuffer cbuffer_constants
|
||||
|
||||
#define FIX_VERTEX_POSITION(x)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user