Here is the first version of SOL raytracer,

Because of the size limit of upload here i removed the textures used in UV texture mapping
You can use any properly named (see inside source code) 2048x1024 jpeg textures one for land/water and one for clouds. the JPEG loading code is included...

As near by future developement as i see it:
------------------------------------------------------
1) add reflexions (this should be easy)
2) add mesh (triangles) and other primitives like torus,cylinders,box,plane
3) add procedural textures also : marble,wood etc
4) add code to do orthographic view/camera and better camera movement/position (look_at,view_angle)

Then (my dreams) i will do either:
-----------------------------------------------------
a) optimize it and hack it to evolve into a relat time raytracer game engine and make the first raytraced game
(i already have the whole ideea of the game :) )

or:

b) optimize it but do not hack it (ie use correct formulas and obtain the best possible quality images as fast as it is possible under current and future CPUs) and create a Moddeler / renderer from it mainly as a real time front end modeler for POV-Ray.

I think i will pursue the both directions... ( to be honest this is my style) and see witch one evolves better.

I release it now because:
- am am late and prommised it :)
- i am busy with HE and SOL OS developement and the Dialog and/or management code has become way too big... overwhelming the raytracer part
-hope to get some help from you guys with : convert to masm and/or developement

I will continue the main line in TASM (beacuse i have the licence and i do not trust MASM licence see:"drivers only stuff" too much) however i might switch to MASM at a later time and /or create my own assembler (another dream)

So i want to release a simple version unitil it gets way out of the reach of beginners and useless for tutorials. Main raytrace functions are in trace.asm and shadow.asm in the \trace subfolder the rest of the cod is just management.

And improved version (faster) of this is used to render the planet and clouds in HE intro screen (latest demo) in realtime.

Regards
Bogdan Ontanu
Posted on 2003-02-04 16:34:00 by BogdanOntanu
Whole source code is included in above zip file and you can get the textures from here:

www.hostileencounter.com/cloud_combined_2048.jpe
www.hostileencounter.com/land_ocean_ice_2048.jpe

but it works without textures also just do not load textures and do not enable UV mapping in options

Also some help:

You can use arrow keys to move selected object (aka speheres just now) on X/Y and PagUp/PagDn to move selected objects forward/backward (on Z)

You can Add/Delete objects in Select Objects Dialog but Edit button is not working yet.
New Objects are are all RED (sorry)

You can select /move camera and light also.
Posted on 2003-02-04 16:43:07 by BogdanOntanu
All: 18 FPS on P3 600Mhz, WinNT.
Nice! :)
Posted on 2003-02-04 17:59:52 by bitRAKE
Thanks for info bitRAKE

Yeah, It has to be optimized a lot... now it is only naive code with one minor optimization

What options and how many objects?

my guess is 2 objects, all options? or w/o UV mapping ?

Besides as you might all notice i have added something to "licence agreement" that will guarantte that this project will always be free and open source (but not GPL) so i wonder if this will rally up some help.

After all we have the source code of POV-RAY and DKBTrake in C sao we could make this (again my dreams) a huge project...but since i already have some huge projects on my hand (HE+SOL OS+assembler) i guess i will need some help here :)

Like optimising this naive code?
Eh i guess i will have to add geometrical sphere/ray intersection soon to test its speed when compared to algebrical equation solution (quadric)
Posted on 2003-02-04 18:03:20 by BogdanOntanu
18 FPS with all options and textures. Pentuim III 450Mhz.
Very nice work. Keep it up.
Posted on 2003-02-05 02:14:53 by sMiLeY-jOnEs
Hi BogdanOntanu,

Nice! I use Win98se, my cpu Celeron 1200 and my video card VIA Tech (onboard). I try 3 times and I see always 28-29 FPS

but i see sometimes (select and deselect some menu items) below error.

have nice days,
Posted on 2003-02-05 05:12:29 by CYDONIA
Hi Bogdan :)
~54 FPS all options enabled but textures, on a Athlon XP ~1750+ (1500 MHz).

If I load the textures, the program crashes. I tried to place the two texture files either in the main dir, and in the texture dir.. but still get a crash when I start ray01.EXE if I loaded the textures. Where should I place them?
Posted on 2003-02-05 05:36:51 by Maverick
Maverick:
------------
They are supposed to be in \tetxure subfoder i.e. the same folder where load_jpeg.asm is located. You can change that path in load_jpeg.asm source code... i just forgot them there ...
CYDONIA:
--------------

What options generated the crash? IF textures please see above...
Posted on 2003-02-05 06:40:47 by BogdanOntanu
with just "diffuse shading" 35 - 37 (for some reason I can't deselect that?)

diffuse shading + specular shading: 34 - 35
diffuse shading + shadows: 30 - 32
diffuse shading + texture mapping: 19 -20
diffuse shading + specular shading + shadows: 30 - 31
diffuse shading + specular shading + texture mapping: 19 - 20
diffuse shading + shadows + texture mapping: 17 - 18
diffuse shading + specular shading + shadows + texture mapping: 17 - 18


attached my systems info
Posted on 2003-02-05 07:17:01 by Hiroshimator
Hi BogdanOntanu,


Oppss!, my fault problem solved :stupid:

All pictures extensions must be .\texture\*.jpe

Nice work!
Posted on 2003-02-05 09:23:41 by CYDONIA

Bogdan,
I re-ran it from the default positions, and it's 40 fps now. It was 54 fps moving the objects someway, but I clearly recall all options were enabled (but textures).

Anyway, textures now work. :alright:
Posted on 2003-02-05 11:12:54 by Maverick
i get around 27-39 FPS on my PIII 667. :)
Posted on 2003-02-05 16:22:47 by jademtech
"make the first raytraced game" has been done - RayMan :tongue:
(well... MOST of it was raytraced...)

The Next Generation of games are moving steadily toward per-pixel art.
This is seen in the growing popularity of pixel shaders as well as in a recent competition for the world's best particle-rendered games - ALL rending had to be comprised of pointsprites or pixelsprites...
Posted on 2003-02-06 20:54:49 by Homer
Kick @zz.

My Celeron 433 gets 10.5fps to 12.5 (when the moon is with the perimeter of the earth)

Are the rotations supposed to be backwards or is it just my backwards hardware ;)
Posted on 2003-02-07 02:05:34 by eet_1024
indeed, nice work. is it possible to enlarge the rendered image?
your code runs with 45 fps on my athlon 1,33 ghz. but you gotta admit that the frames break down with 10 objects in the list - you won't be able to write game with that, but -- nice demo

greets, hartyl
Posted on 2003-02-07 13:31:03 by hartyl
EvilHomer2k:
------------------
What i mean is a full raytraced game not just some raytraced stuff, in that regard HE could be considered raytraced because we use some raytracing in it :)

I mean no 3D accelerated hardware (until video boards makers switch direction and integrate raytracer functions in hardware), real shadows and reflexions, shading of curved surfaced no simulation via mesh/triangles etc... It is a dream of course

eet_1024
---------------
Thanks, about rotations: well, it is not intended to be a real Earth/Mooon simulation ... just my testing pad

hartyl
-----------
Well this code is NAIVE ASM ... no real optimizations are done yet... besides the ray-generation stuff
You can change the render size in trace.asm


TRACE_DX_START EQU 292
TRACE_DY_START EQU 192

change them to your needs and recompile... I will add this resolution change option to menus in next version.
Curently it was setup to HE intro screen planet sizes.

Basically i am sure and/or i sure hope that this stuff can be optimized a lot!

I keept it unoptimized because i wanted ppl understand it easy, and i usually make my optimizations at the end my friend...

And i think it is performing quite well for such unoptimized version, it is aparently much faster than some HLL demos i have seen (and they cheat a lot) ... while i render every pixel each time

But yes i think we need a 20Ghz+ CPU to make a realtime raytraced game... i just want to be there when they are :)
Posted on 2003-02-07 16:47:25 by BogdanOntanu
on a side note, i guess it's not a good idea to rewrite POV-RAY in asm since its source is 4.1 MB zipped... (nothing to do /w rt raytracing)
Posted on 2003-02-08 11:11:09 by jademtech
POV-Ray is also very slow. IIRC, Wolfenstein uses some raytracing but I don't know how rt could be used in a real time game. Of course, game, to me, means HitMan, Predator, Counterstrike.
Posted on 2003-02-08 12:59:14 by drhowarddrfine
Posted on 2003-02-13 02:40:15 by AmkG
Bogdan, when you say "no simulation via mesh/triangles",
it makes me curious as to how else you might define geometry...
Maybe something like NURBS or regular BSPLINE type stuff?

Or are you just referring to texturing of geometry?

I thoroughly agree that the UV system of texturemapping
is a little primitive, and I think perhaps the recent moves toward
fractal compression of images will open new methods of texturemapping - if the source images are created with fractal brushes and not converted
to fractal compressed images...
Anyhow I am just happy to see someone exploring the boundaries, and pushing the envelope... innovation leads to experience and excellence.
Wondering how you feel about portal rendering in respect to real raytracing?
Also, how you feel about reflective surfaces?
Posted on 2003-02-13 05:31:54 by Homer