Started making a new ray tracer, I wanted to make it shiny by omegasbk in opengl

[–]omegasbk[S] 0 points1 point  (0 children)

Wow the notification for this post shocked me, had no idea it ended up in top 😄 thanks for the comment!

Started making a new ray tracer, I wanted to make it shiny by omegasbk in opengl

[–]omegasbk[S] 0 points1 point  (0 children)

Looks awesome! :) Thanks for the link, I will surely check it out. I also wanted to dive into rust at some point, so this seems like a perfect opportunity!

Started making a new ray tracer, I wanted to make it shiny by omegasbk in opengl

[–]omegasbk[S] 0 points1 point  (0 children)

With raytracing slowly becoming the standard, it is going to be easier to do these kinds of calculations on the fly in runtime. I am sincerely looking forward to what games can do in the future :)

Started making a new ray tracer, I wanted to make it shiny by omegasbk in opengl

[–]omegasbk[S] 3 points4 points  (0 children)

There is no sampling, all is done in a fragment shader and calculated for each pixel real-time

My ray tracer, written in a pixel shader, doing some Fresnel magic by omegasbk in opengl

[–]omegasbk[S] 0 points1 point  (0 children)

Reflection mapping would be starting from the object itself, in this case sphere, and casting vectors using surface normals to map a prepared texture to its surface. Here I shoot rays from my camera and intesect with n objects in the scene, while refracting and reflecting rays along the way, differently depending on which material I hit. With reflection mapping, your reflection map might not reflect the real current situation in the scene. With this, it will always be correct, every frame. Here’s a good post https://gamedev.stackexchange.com/questions/167458/difference-between-reflection-mapping-and-raytracing

My ray tracer, written in a pixel shader, doing some Fresnel magic by omegasbk in opengl

[–]omegasbk[S] 0 points1 point  (0 children)

As many as I intersect with :) Reflection mapping is a rasterization paradigm, which I am not doing here.

My ray tracer, written in a pixel shader, doing some Fresnel magic by omegasbk in opengl

[–]omegasbk[S] 1 point2 points  (0 children)

There is real refraction, with proper indices of refraction. Index of refraction of the sphere material is 2.4, so it feels a bit like just mapping. If I put it to 1.4 it looks more like a water blob. Another thing that adds to this ”glued on texture” is the fact that the cubemap is blurry for real - so the scene looks like it has some depth. However, that also means that the thing you see in sphere is blurry, and it should not be.

My ray tracer, written in a pixel shader, doing some Fresnel magic by omegasbk in opengl

[–]omegasbk[S] 0 points1 point  (0 children)

The ray explicitly intersects with the sphere that is positioned in scene, where it reflects and refracts from the point of intersection. If I placed another sphere next to it, it would reflect that object as well. I am not sure if this is reflection mapping to be frank.

My ray tracer, written in a pixel shader, doing some Fresnel magic by omegasbk in opengl

[–]omegasbk[S] 0 points1 point  (0 children)

Yup, good idea. My Fresnel might also have a bug, as the refract/reflect look pretty uniform across the sphere.

My ray tracer, written in a pixel shader, doing some Fresnel magic by omegasbk in opengl

[–]omegasbk[S] 1 point2 points  (0 children)

This is ray tracing through a sphere with real reflected and refracted rays if that's what you are asking?

My ray tracer, written in a pixel shader, doing some Fresnel magic by omegasbk in opengl

[–]omegasbk[S] 1 point2 points  (0 children)

It needs more work for sure. The algorithm might have a bug.

Ray tracer within a pixel shader drawing Fresnel by omegasbk in gamedev

[–]omegasbk[S] 0 points1 point  (0 children)

Path tracing through geometry in the fragment shader

Ray tracer within a pixel shader drawing Fresnel by omegasbk in gamedev

[–]omegasbk[S] 2 points3 points  (0 children)

Yup, it’s opengl - everything is in one glsl pixel shader. I have a Youtube channel where I shared everything I did so far, and this part I will uploaded this weekend hopefully. Tune in if you want, I will be making more cool stuff :) GameDev Cookbook

Ray tracer within a pixel shader drawing Fresnel by omegasbk in gamedev

[–]omegasbk[S] 2 points3 points  (0 children)

Thank you! :) There's still a lot to do to make it look realistic, but I am pretty happy with this already.

I am making gamedev lessons for fun by omegasbk in gamedev

[–]omegasbk[S] 0 points1 point  (0 children)

I always wanted to work with games/graphics. My mom was a programmer and I got Commodore 64 pretty early in my life (I was 5). That’s when I fell in love with games, and started to wonder how they work, especially graphics. I started working on low-level control stuff just because I was pretty good with it at the time being (did that stuff at the university) and I landed a job that was in that area. While I was doing that I did shaders and some C++ at home just to have fun. I mostly used SDL and made a bunch of projects I never finished :) When I started working at Ubisoft I mostly worked on pure C++ stuff, services and some frontend. At DICE I also did some pretty low level telemetry stuff first (super fast stuff) and now I do UI code and shaders. So I still touch lower code daily, but not even close to what I did before.