Daz NSRT - first Raytracer (17.08.2019)

NSware

Member
Jul 22, 2018
189
121
Thank you, for your wanted help recreation & Saki_Sliz .
Now i Fix some problems, and work on the Opacity/Transparent Map and Reflections...

I need help for Color-Calculation
If i hit a Triangle with lower Transpanrent and than a Trinagle with non Transpanrent...how i should calculate???

Thank you
Opacity/Transparent test : Specular + Ambient Occlusion + Shadow + Bump Map + Opacity
opatest.png

Specular + Ambient Occlusion + Shadow + Bump Map


saod.png
Ambient Occlusion

Test with Shadow
aos.png
Second Test
ao.png

First Test
AO01.png



r2.png
r1.png

r0.png
A
 
Last edited:

Saki_Sliz

Well-Known Member
May 3, 2018
1,403
1,011
Very cool, I do know some articles about how to implement the normal map, but it depends on the code you are using.
 
  • Like
Reactions: NSware

recreation

pure evil!
Respected User
Game Developer
Jun 10, 2018
6,327
22,773
I don't know how to calculate them, but here is a nice article about that explains the difference of the maps quite well:
I've rad it a while ago and it made me understand the difference between them and when and for what to use which map.
 
  • Like
Reactions: NSware

NSware

Member
Jul 22, 2018
189
121
What are you trying to achieve with this?? or is it learning purposes?
Greetings, So what I'm trying to write is a fast raytracer that gives a good result.
If that is the case, will be published ..... if not not;)
 

NSware

Member
Jul 22, 2018
189
121
I don't know how to calculate them, but here is a nice article about that explains the difference of the maps quite well:
I've rad it a while ago and it made me understand the difference between them and when and for what to use which map.
THX, the Part with the Bump map, was helpfull !!!!
 

Saki_Sliz

Well-Known Member
May 3, 2018
1,403
1,011
whoa, you got Ambient occlusion in?! that is something I have wanted to play with, at least with texture generation. what are you using for code? are you making custom shaders like open shader language, or are you coding in things raw like with C or something similar?
 

NSware

Member
Jul 22, 2018
189
121
whoa, you got Ambient occlusion in?! that is something I have wanted to play with, at least with texture generation. what are you using for code? are you making custom shaders like open shader language, or are you coding in things raw like with C or something similar?
writen all in C#.....I don´t use Directx or Opengl....I load all Vertices, build the Trinagles....Genarate a world of Boxes to add vertices-Ids in it...for fast rendering....and the send the rays...
 

NSware

Member
Jul 22, 2018
189
121
//Ambient Occlusion
float amount = 0.5f;
float end = 0.5f;
for (float xx = -end; xx <= end; xx+=amount)
{ for (float yy = -end; yy <= end; yy += amount)
{ for (float zz = -end; zz <= end; zz += amount)
{
Vector3 dir = NearestInersection.Normal + new Vector3(xx, yy, zz);
Ray aotray = new Ray((NearestInersection.Position + Vector3.Multiply(NearestInersection.Normal, 0.0000001f)), dir);
RenderPixel(new object[] { aotray, x, y, thread, RayOption.AO, NearestInersection, currentBound + 1 });
}
}
}