More ray tracing changes

This commit is contained in:
Dynamitos
2024-07-10 21:07:10 +02:00
parent acf8dde8fc
commit a9089bd997
46 changed files with 801 additions and 277 deletions
+8 -1
View File
@@ -4,7 +4,6 @@
#include "Resources.h"
#include "VertexData.h"
namespace Seele {
namespace Gfx {
@@ -100,6 +99,7 @@ struct ShaderPermutation {
uint8 positionOnly;
uint8 depthCulling;
uint8 visibilityPass;
uint8 rayTracing;
// TODO: lightmapping etc
ShaderPermutation() { std::memset(this, 0, sizeof(ShaderPermutation)); }
void setTaskFile(std::string_view name) {
@@ -117,6 +117,11 @@ struct ShaderPermutation {
useMeshShading = 1;
strncpy(vertexMeshFile, name.data(), sizeof(vertexMeshFile));
}
void setRayTracingFile(std::string_view name) {
std::memset(vertexMeshFile, 0, sizeof(vertexMeshFile));
rayTracing = true;
strncpy(vertexMeshFile, name.data(), sizeof(vertexMeshFile));
}
void setFragmentFile(std::string_view name) {
std::memset(fragmentFile, 0, sizeof(fragmentFile));
hasFragment = 1;
@@ -149,6 +154,7 @@ struct ShaderCollection {
OTaskShader taskShader;
OMeshShader meshShader;
OFragmentShader fragmentShader;
OClosestHitShader closestHitShader;
};
struct PassConfig {
@@ -161,6 +167,7 @@ struct PassConfig {
bool hasTaskShader = false;
bool useMaterial = false;
bool useVisibility = false;
bool rayTracing = false;
};
class ShaderCompiler {
public: