Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   WIP: My Raytracer (https://simplymaya.com/forum/showthread.php?t=20118)

MattTheMan 14-04-2006 06:30 PM

1 Attachment(s)
ok, so I started coding again.

I started from scratch. My program has support for triangles and supersampling, not to be confused w/ anti-aliasing, even though they have the same result, my program just samples each pixel 4 times(this can be increased or decreased, but at 4 samples it takes about a second to render). I can, however add true AA, the comp checking itself for aliasing and just supersampling the pixels that need it.

However, that doesnt always work, and mine always works. But mine wastes a ton of time basically rendering the scene 5 times....

MattTheMan 14-04-2006 07:30 PM

1 Attachment(s)
Next up- soft shadows (raytraced shadows, in Maya terms).
First, however I will make it just as if it was a grid of shadow casting lights on the area light, and then I will make my program a Monte Carlo tracer! Yay!

Monte Carlo is simply a method that goes like this:

Enough random samples and their average will become the correct answer.

So then I will randomly jitter the position of the samples for the area light, and that will replace the banding that will occur with noise. Then I will increase the samples until- voila, a perfect soft shadow.

DJbLAZER 14-04-2006 10:33 PM

Nice going...I'm thinking about writing a raytracer myself since am taking a "Advanced Computer Graphics"-course right now. Would be good for the exam.

What codebase are you using? Since you're re-writing "from scratch" every now and then you can't seriously start with an empty cpp-file... it would take ages juts to get a pixel on the screen.

DJbLAZER 14-04-2006 11:08 PM

I can see now that you're using the code from the tutorial at flipCode....

MattTheMan 14-04-2006 11:35 PM

1 Attachment(s)
im not copying it, and my coding is much simpler then theirs...
i have no clue how to do inheritance sampling or polymorphism, so my code is WAAAY different then theirs.

Plus when I go into monte carlo Global Illumination and caustics, I have my own (thats right, my own) methods that are 10x slower and 100x simpler then the norm. Such as storing a huge array of 2d points and then comparing all thousands of them agains the non-gi rendered pic at each pixel, and then adding colors as the 2d map said.

But its true that most of my code did come from flipcode THE FIRST TIME I WROTE IT. Then I couldnt figure out what was happening in my own code, so I rewrote it with an "adapted" form of the flipcode codes. Now, this 3rd time I am writing it completely on my own, simply because flipcode's renderer isnt a Monte Carlo based Path Tracer, and mine will be.

Now, here is my first soft shadow render

MattTheMan 15-04-2006 02:16 PM

1 Attachment(s)
Yay! We have noise! Noise is much better then bands.

We are much more used to noise... like when you try to find your way around in the dark, you see tons of noise.

This is rendered with a jittered regular grid area light, 16 light rays per pixel.

MattTheMan 15-04-2006 02:36 PM

1 Attachment(s)
This is the effect of supersampling on the noise. I increased the scattering of the light (by 2 times) and added 2 samples (5 per pixel) supersampling.

Of course, it took way longer to render, and the quality is about the same as if I had increased the shadow rays to 81. But I'm sure the 81 samples would take longer to render.

MattTheMan 15-04-2006 07:16 PM

1 Attachment(s)
my last, non-gi render... next one will have path tracing on... sniff...

gohan1842 15-04-2006 07:36 PM

Nice little raytracing program. Learning some of the basics of c++ I see.

I program myself. Me and my dad made this program. It gets quite a few sales.

http://www.grantfullen.com/index.php...c=detail&pid=1

MattTheMan 15-04-2006 08:08 PM

cool! is your dad a programmer?

arneoog 16-04-2006 11:04 AM

Wow! Nice Software!

This is amazing for a 13 year old!!!
I'm 16 and I'v thought about learning c++ my self.

I was wondering if you could tell how you started, what was the first you did to start learning c++?
And what software do you use for the programming?

Thanks! And again, Nice Software! :)

MattTheMan 16-04-2006 12:23 PM

thanks!

Well the first thing I did was googled "beginner's c++ tutorials" then, I learnd a bit from there, and I bought c++ for dummies.

Then I decided what I wanted to program (raytracer) and I started reading on vector maths, calculus, linear algebra, etc...

As for compiler- im using a free compiler called DevC++ and also I am using 2 libraries to put pixels on the screen- SDL and QuickCG. Both are easy to install and work like a charm.

Anyway... I really need to get my ass in gear now, I am still just reading papers on Monte Carlo Path Tracing, and I don't understand a lot of it.

Also, I was thinking about making my renderer an Unbiased Renderer, but that would mean implementing Metropolis Light Transport, andI really don't want to go there.

l8er :beer:
Matt :alien:

MattTheMan 16-04-2006 02:21 PM

1 Attachment(s)
Ok, so I added reflections on top of soft shadows. Just cuz I need reflections and refractions for my Global Illumination and caustics algorithms, and I just want to make sure that they work. And while I am at it, I will add glossy reflections. I am working on it now.

However, its a much more complicated concept, that involves semi-random hemispherical sampling, but if I can do that, then I can do global illumination too.

MattTheMan 17-04-2006 03:20 PM

1 Attachment(s)
lol, I have to warn everybody- this is NOT the right way to do glossy reflections LOL :p

Joopson 18-04-2006 01:05 AM

looks cool either way:p


All times are GMT. The time now is 09:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018