Mini-Ray Raytracer

miker1264 · 1700

salvo

  • Legendary Member
  • *****
    • Posts: 1156
    • Karma: +14/-4
  • Invalid Civil
Reply #15 on: June 29, 2021, 05:13:15 PM
thank you miker :)

Software Contributor RNOPublisher, RNOArchive

Sign Up On AmigaMap
https://amigamap.com/


miker1264

  • Legendary Member
  • *****
    • Posts: 748
    • Karma: +34/-2
Reply #16 on: June 30, 2021, 06:37:14 AM
Raytracer Test Program in action. It compiles in C code for x86_64.



paolone

  • Senior Member
  • ****
    • Posts: 454
    • Karma: +16/-0
Reply #17 on: June 30, 2021, 09:12:03 AM
@Miker


Great work as usual! Thank you for keeping us updated about this.


Argo

  • Junior Member
  • **
    • Posts: 61
    • Karma: +1/-0
  • Argo
    • Find me on the Fediverse
Reply #18 on: June 30, 2021, 09:55:13 AM
Nice, This will be great to have on AROS



AMIGASYSTEM

  • Legendary Member
  • *****
    • Posts: 711
    • Karma: +32/-1
  • AROS One
    • AROS One
Reply #19 on: June 30, 2021, 10:12:53 AM
miker great tool, AROS One will be happy to host it   :)

For Mini-Ray Raytracer I made a News on Amiganews.it, i will make it on EAB later, hope you like it. ;)


salvo

  • Legendary Member
  • *****
    • Posts: 1156
    • Karma: +14/-4
  • Invalid Civil
Reply #20 on: June 30, 2021, 02:31:33 PM
I'm happy miker having fun while you apply to the development of the program :)

Software Contributor RNOPublisher, RNOArchive

Sign Up On AmigaMap
https://amigamap.com/


miker1264

  • Legendary Member
  • *****
    • Posts: 748
    • Karma: +34/-2
Reply #21 on: July 01, 2021, 03:59:14 AM
You may think that over the last few days I have miraculously written a complete raytracer that actually works. But in reality that isn't the case. I was prepared to write it from scratch but raytracers are by nature complicated pieces of software. It seems there are many samples of raytracers available, though. However, they are nearly all written in C++ which doesn't fit my needs for a working raytracer for AROS.

Mini-Ray was one such simplistic C++ version of raytracer that contained everything in one module - "raytracer.cpp". I've been looking at that code wondering first how to convert it to C code, then how to expand it to actually render polygon meshes with lots of triangles. Yesterday I discovered a simple raytracer written in C code that seemed to have all the qualities needed.

But there is still plenty of hard work to do to make it into a nice AROS-friendly graphics application. It needs to run from Workbench and it needs a menu system and much more.
« Last Edit: July 01, 2021, 07:35:55 AM by miker1264 »



salvo

  • Legendary Member
  • *****
    • Posts: 1156
    • Karma: +14/-4
  • Invalid Civil
Reply #22 on: July 01, 2021, 12:16:28 PM
i understand miker

Software Contributor RNOPublisher, RNOArchive

Sign Up On AmigaMap
https://amigamap.com/


miker1264

  • Legendary Member
  • *****
    • Posts: 748
    • Karma: +34/-2
Reply #23 on: July 02, 2021, 11:41:39 PM
i understand miker

The raytracer being worked on now I ported from Mac OS (x-code) for use on AROS. Not everything was compatible.

It took about 5 hours to make it work correctly. I must have tried to compile it about two dozen times. It was setup to use Png Library or "cmfts" or something like that for display purposes.

But it wasn't as much "display" as it was "saveToFile. So I re-wrote all of that. Now it uses "ppm_render" which saves directly to ppm which AROS pnm datatype can read. Next I will work on a menu system and try to get the polygon mesh to render.
« Last Edit: July 02, 2021, 11:45:25 PM by miker1264 »



salvo

  • Legendary Member
  • *****
    • Posts: 1156
    • Karma: +14/-4
  • Invalid Civil
Reply #24 on: July 03, 2021, 12:46:38 PM
ok miker well, i'm happy :)

Software Contributor RNOPublisher, RNOArchive

Sign Up On AmigaMap
https://amigamap.com/


salvo

  • Legendary Member
  • *****
    • Posts: 1156
    • Karma: +14/-4
  • Invalid Civil
Reply #25 on: July 04, 2021, 02:49:16 PM
Miker are working on an module Raytracer open source?

Software Contributor RNOPublisher, RNOArchive

Sign Up On AmigaMap
https://amigamap.com/


miker1264

  • Legendary Member
  • *****
    • Posts: 748
    • Karma: +34/-2
Reply #26 on: July 04, 2021, 04:14:14 PM
Miker are working on an module Raytracer open source?

Yes. Salvo.

The Raytracer sources will be available as open source. I'm currently fixing the rendering process for polygon meshes. It seems to be seriously broken! I may need to re-write much of the rendering code to make it work. It's not an easy task.



salvo

  • Legendary Member
  • *****
    • Posts: 1156
    • Karma: +14/-4
  • Invalid Civil
Reply #27 on: July 04, 2021, 06:47:15 PM
Excuse me but you are working on Raystorm sources or something else

Software Contributor RNOPublisher, RNOArchive

Sign Up On AmigaMap
https://amigamap.com/


miker1264

  • Legendary Member
  • *****
    • Posts: 748
    • Karma: +34/-2
Reply #28 on: July 04, 2021, 09:46:21 PM
Excuse me but you are working on Raystorm sources or something else

I will likely refer to RayStorm sources as a guide for reading and writing SCN Project Files and for Import and Export of 3DS Files.
For the rest of the raytracer I am using other raytracer sources that are written in C code. That makes things easier.

There is still a problem with rendering 3D Polygon Mesh. It now loads the vertices and triangles from the txt file correctly, though I had
to double the buffer size for each. It was hard-coded at 1500 each which was much too small causing an error. I will need to automate
the buffer size allocation by counting lines in the text file. That will alleviate the size allocation problem in the future for polygon meshes.

Since it fails to render the polygon mesh correctly and only returns colors very similar to the background color I suspect that the problem
may be an error in the Triangle Intersection Algorithm. It fails to detect an intersection with the polygon surface so it returns the background.

https://www.scratchapixel.com/lessons/3d-basic-rendering/ray-tracing-rendering-a-triangle/ray-triangle-intersection-geometric-solution
« Last Edit: July 05, 2021, 01:37:18 AM by miker1264 »



salvo

  • Legendary Member
  • *****
    • Posts: 1156
    • Karma: +14/-4
  • Invalid Civil
Reply #29 on: July 05, 2021, 12:23:23 PM
I understand miker, you're doing an excellent job, you're definitely developing everything from the beginning, if you want on aminet there is a source of a program that makes use of wazp3d I don't know if it is written in c however it is a complete rendering program, of course it's not blender but her work is very well :)

https://aminet.net/gfx/3d/Skulpt_doc.lha
https://aminet.net/gfx/3d/Skulpt_src.lha

Software Contributor RNOPublisher, RNOArchive

Sign Up On AmigaMap
https://amigamap.com/