Skip to content

Commit

Permalink
Improve brute pathtracer
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Dec 3, 2024
1 parent df42b99 commit 74dcdd5
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 6 deletions.
Binary file modified base/shaders/raytrace/raytrace_brute_core.spirv
Binary file not shown.
Binary file modified base/shaders/raytrace/raytrace_brute_forge.spirv
Binary file not shown.
Binary file modified base/shaders/raytrace/raytrace_brute_full.spirv
Binary file not shown.
4 changes: 2 additions & 2 deletions base/shaders/raytrace/src/raytrace_brute.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#define _TRANSLUCENCY
#define _ROULETTE
#define _TRANSPARENCY
#endif
#define _FRESNEL
#endif
// #define _RENDER

#include "std/rand.hlsl"
Expand Down Expand Up @@ -74,7 +74,7 @@ void raygeneration() {
float2 screen_pos = xy / DispatchRaysDimensions().xy * 2.0 - 1.0;
RayDesc ray;
ray.TMin = 0.0001;
ray.TMax = 10.0;
ray.TMax = 100.0;
generate_camera_ray(screen_pos, ray.Origin, ray.Direction, constant_buffer.eye.xyz, constant_buffer.inv_vp);

RayPayload payload;
Expand Down
4 changes: 0 additions & 4 deletions base/shaders/raytrace/src/std/math.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
#include "rand.hlsl"

void create_basis(float3 normal, out float3 tangent, out float3 binormal) {
// tangent = abs(normal.x) > abs(normal.y) ?
// normalize(float3(0.0, normal.z, -normal.y)) :
// normalize(float3(-normal.z, 0.0, normal.x));
// binormal = cross(normal, tangent);
float3 v1 = cross(normal, float3(0.0, 0.0, 1.0));
float3 v2 = cross(normal, float3(0.0, 1.0, 0.0));
tangent = length(v1) > length(v2) ? v1 : v2;
Expand Down

0 comments on commit 74dcdd5

Please sign in to comment.