Hello! I am completely and utterly knowledge-less with Raytracing and any shadow stuff and shaders. I was wondering, where should I begin? How do I learn to create a simple raytracing test with squares and a point and shadows? Also, how would I use this to make 3D stuff?
I've tried making 3D things before but I just failed terribly. What's the most efficient way? Can somebody explain to me how translating 3D to a 2D plane works? Can somebody explain to me how raytracing works? Or at least point me in the right direction with articles that aren't advanced (orientated for beginners)?'
edit: Raycasting, I mean
Where to begin with RayTracing?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Where to begin with RayTracing?
Last edited by iPoisonxL on Sun Dec 21, 2014 3:28 pm, edited 1 time in total.
Code: Select all
L
L Ö
Ö V
L Ö V E
Ö B E
V E
E Y
Re: Where to begin with RayTracing?
For starting out, I'd recommend brewing some nice Tea, getting some snacks ready and watching this keynote by John Carmack:
Principles of Lighting and Rendering with John Carmack at QuakeCon 2013
(watch on youtube to enable fullscreen)
This gives you a nice overview how everything works, and what to look for if you want to dig in deeper.
Principles of Lighting and Rendering with John Carmack at QuakeCon 2013
(watch on youtube to enable fullscreen)
This gives you a nice overview how everything works, and what to look for if you want to dig in deeper.
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: Where to begin with RayTracing?
Hi,
I might have a couple of links that can be helpful.
RayTracing is a quite wide topic. I do not have a great experience on the topic, nubut I remember having played with it a while back.
I just found those old articls I used at that time to learn the topic.
Raycasting tutorial on lodev
F. Permadi's tutorial series on Raycasting
Also, I have two unfinished implementations on github, that you can take a look at. See smallpt-lua (which is a Lua port of the original small-pt raytracer) and raytracer. You can also search on Github using the keyword "raytracer" or "raytracing", there are dozens of them. Make sure to checkout Minilight, it is a global illumination raytracer written in Haxe, and ported in lots of languages. It is fast, and very well written.
Hope this helps.
I might have a couple of links that can be helpful.
RayTracing is a quite wide topic. I do not have a great experience on the topic, nubut I remember having played with it a while back.
I just found those old articls I used at that time to learn the topic.
Raycasting tutorial on lodev
F. Permadi's tutorial series on Raycasting
Also, I have two unfinished implementations on github, that you can take a look at. See smallpt-lua (which is a Lua port of the original small-pt raytracer) and raytracer. You can also search on Github using the keyword "raytracer" or "raytracing", there are dozens of them. Make sure to checkout Minilight, it is a global illumination raytracer written in Haxe, and ported in lots of languages. It is fast, and very well written.
Hope this helps.
Re: Where to begin with RayTracing?
Thanks both of you, I'm looking into the tutorials and video now.
edit: I'm trying to understand these, but I'm just not able to write it down in lua.
This is ultimately what I'm trying to achieve:
I didn't make this but it's in my folders for reference, except this uses shaders. I don't want to use shaders, and if I must I'd like a proper shader tutorial that I can't find anywhere.
edit: I'm trying to understand these, but I'm just not able to write it down in lua.
This is ultimately what I'm trying to achieve:
I didn't make this but it's in my folders for reference, except this uses shaders. I don't want to use shaders, and if I must I'd like a proper shader tutorial that I can't find anywhere.
Code: Select all
L
L Ö
Ö V
L Ö V E
Ö B E
V E
E Y
Re: Where to begin with RayTracing?
I was trying to do something what you have in the picture, although the code I did for LUA is pretty much vommit, tons of globals etc, but here is the code. It probably also has some strange debug output not to mention finnish names I think. It was one of those first lines I did write in LUA. Although I don't think that is exactly what I would call raytracing.
I think raytracing means that you are kind of doing inverse traveling from monitor to forward. Then trying to value the color of the pixel based on the object the ray hits and from that point trying to calculate all possible directions light would travel from to that point. Well I think other people can explain / know it better.
Anyways here is my version of trying to count if line a overshadows other lines. It seems to have some bugs too + it probably isnt even what youre looking for. And like said its very unoptimized and horrible terrible code to read.
I think raytracing means that you are kind of doing inverse traveling from monitor to forward. Then trying to value the color of the pixel based on the object the ray hits and from that point trying to calculate all possible directions light would travel from to that point. Well I think other people can explain / know it better.
Anyways here is my version of trying to count if line a overshadows other lines. It seems to have some bugs too + it probably isnt even what youre looking for. And like said its very unoptimized and horrible terrible code to read.
- Attachments
-
- weird_light_thingy.love
- (7.59 KiB) Downloaded 126 times
Re: Where to begin with RayTracing?
Sadly this is all I'm gettingMuris wrote:I was trying to do something what you have in the picture, although the code I did for LUA is pretty much vommit, tons of globals etc, but here is the code. It probably also has some strange debug output not to mention finnish names I think. It was one of those first lines I did write in LUA. Although I don't think that is exactly what I would call raytracing.
I think raytracing means that you are kind of doing inverse traveling from monitor to forward. Then trying to value the color of the pixel based on the object the ray hits and from that point trying to calculate all possible directions light would travel from to that point. Well I think other people can explain / know it better.
Anyways here is my version of trying to count if line a overshadows other lines. It seems to have some bugs too + it probably isnt even what youre looking for. And like said its very unoptimized and horrible terrible code to read.
Code: Select all
L
L Ö
Ö V
L Ö V E
Ö B E
V E
E Y
Re: Where to begin with RayTracing?
I guess that is what I get when I try to pull bad code out of bigger portion. I forgot to disable the wasd-keys. Basically the whole point of the thing is just to kind of calculate the "light" area when you drag lines (set walls) with left mouse button. You can turn the light area with right mouse. The whole thing is a test if I can somehow figure out if an object is shadowed by another object, which in this case would be lines (= walls). Later on I was planning to change that into polygons, but I kind of got distracted by something else and forgot the whole project.
What I was trying to accomplish was something of a line of sight thing on a 2d top-down stealth type of a game, where npcs would be guarding something and you would want to avoid being detected and you could move behind various walls or objects.
What I was trying to accomplish was something of a line of sight thing on a 2d top-down stealth type of a game, where npcs would be guarding something and you would want to avoid being detected and you could move behind various walls or objects.
Re: Where to begin with RayTracing?
That's neat, I like it. But I feel RayTracing like this would be quite difficultMuris wrote:I guess that is what I get when I try to pull bad code out of bigger portion. I forgot to disable the wasd-keys. Basically the whole point of the thing is just to kind of calculate the "light" area when you drag lines (set walls) with left mouse button. You can turn the light area with right mouse. The whole thing is a test if I can somehow figure out if an object is shadowed by another object, which in this case would be lines (= walls). Later on I was planning to change that into polygons, but I kind of got distracted by something else and forgot the whole project.
What I was trying to accomplish was something of a line of sight thing on a 2d top-down stealth type of a game, where npcs would be guarding something and you would want to avoid being detected and you could move behind various walls or objects.
Code: Select all
L
L Ö
Ö V
L Ö V E
Ö B E
V E
E Y
Re: Where to begin with RayTracing?
If you are first looking for casting shadows in 2D, not 3D, i think these videos explains the idea behind the shadowcasting pretty well.
But I don't fully understand what you are trying to do. 2D or 3D. Also raytracing and shadow casting are kind of different things, but if your goal is to do something like you had in the picture, then you should go with shadow casting, which is something like this project: viewtopic.php?f=5&t=78998
If you are on the otherhand going for raytracing, that is completely a different thing.
But I don't fully understand what you are trying to do. 2D or 3D. Also raytracing and shadow casting are kind of different things, but if your goal is to do something like you had in the picture, then you should go with shadow casting, which is something like this project: viewtopic.php?f=5&t=78998
If you are on the otherhand going for raytracing, that is completely a different thing.
Who is online
Users browsing this forum: Ahrefs [Bot] and 6 guests