I'm having some issues getting unreal to compile my code when I use a struct as output type of a function. For example, I made this struct: struct SDFHitResult { float hit; float3 hitpos; float objectID; float t; }; This compiles fine, but if I use this like here: SDFHitResult SphereTrace(float3 ro, float3 rd, int…
Yeah they are cool and simple. Here are the codes if anyone wants to play... Mandelbrot set: float2 z = 0;float2 c = 0; c = float2 ((coord.x -0.5) * scale - center.x,(coord.y-0.5) * scale - center.y); z = c; for (int i = 0; i < iter; i++){ float x = (z.x * z.x - z.y * z.y) + c.x; float y = (z.y * z.x + z.x * z.y) + c.y;…
The reflections and shadows look nice. I was also experimenting with area lights and shadows, but this is some next level stuff. Fun stuff. I think you need to wrap your functions inside a struct to be able to reference other structs. #ifndef RAYMARCHING #define RAYMARCHING struct SDFHitResult { float hit; float3 hitpos;…
Got the whole scene to reflect and to be reflected. So far I'm getting really good performance, and I'm curios to see how much worse it gets once I start adding much more complexity. Currently I'm having nearly 500 fps on a 2080ti on 1080p resolution, when the scene fills the whole screen. Next time I'll add reflections on…
Almost there: https://www.youtube.com/watch?v=AsyJ9dX-GAY&feature=youtu.be @edoublea I use "lagged floats" like Ryan. I get the xy linear and angular velocity, choose the larger between the linear and angular one. Put them in 2 scalar parameter, and slowly fade them out when there is no movement. Then I manipulate some…
I've been following along with Fake Fluid Sims Week as well.... it seems like the popular technique people are using is a Vertex Shader accessing a Read/Write Compute Shader, and manipulating the verts directly. This looks more like a fragment-shader mask approach. Would love some more info, but here's my guess: Looks like…
So I was thinking about the acceleration structure. I also made some initial tests. After all, I don't think uniform grid is a horrible idea for ray marching. I have something in mind, kinda like there is a float2 volume texture grid. and it holds start and end coordinate for a 2d texture containing object lists (objects…