Oberon Community Platform Forum
October 16, 2019, 02:51:08 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: www.scratchapixel.com  (Read 26291 times)
sage
Full Member
***
Posts: 170



WWW
« on: June 19, 2008, 06:29:43 AM »

Hi All,

There is new free ray-tracing online tutorial appear on web: http://www.scratchapixel.com/tutorials/home/home.php
They needs colaboration. And they plan to publish tutorial examples for many existing operating systems.

How about to ask them to publish tutorial examples for Bluebottle also. And as colaboration to supply them examples' code in Active Oberon  Wink
They allready had published a few of examples in rather clean C++ code.
Logged
sage
Full Member
***
Posts: 170



WWW
« Reply #1 on: June 26, 2008, 06:49:06 PM »

Hi All!
I've successfully translated the first lesson's C++ source code to Active Oberon with full preservation of C++ style operator overloading stuff ! Smiley

PS. Bluebottle lacks of ppm file format support, but in other software generated picture looks perfect  Grin

* lesson1.Mod (10.86 KB - downloaded 478 times.)

* raytrace.png (10.96 KB, 320x240 - viewed 1397 times.)
« Last Edit: June 26, 2008, 07:02:04 PM by sage » Logged
sage
Full Member
***
Posts: 170



WWW
« Reply #2 on: July 01, 2008, 10:07:12 AM »

My letter to scratch-a-pixel team:
Quote
Hi, scratch-a-pixel team!!!

Thanks for great ray-tracing tutorial!

As I understand, you plan to release source code compatible with other operating systems.
I've had successfully port first lesson's source to Active Oberon language. It's modern high-level safe programming language and runtime, supporting parallel programming based on concept of Active Objects, garbage collection, modular design. Language also supports operator overloading.

There are exists operating system fully writen on this language http://en.wikipedia.org/wiki/Bluebottle_OS

Oberon/Bluebottle's comunity page with forum: http://www.ocp.inf.ethz.ch/

It's beautifull OS with GUI, networking, device drivers and so on. It runs on bare hardware in multicore / multiprocessor environments. May run on the top of host Windows/*nix systems, as WinAos and UnixAos applications respectively.
OS distribution includes all sources, compiler and simple IDE.

I plan to port all lessons, so will be nice if you'll publish them in yours site download section!  Smiley

First lessons' code attached to this message (Oberon's source files has .Mod extension).

And nice respond:
Quote
Yaroslav

Thanks a lot for your email. To be honest we haven't thought people 
would send us code for other platforms so soon so we don't really 
know yet what to do with yours Wink We envision two possibilities. One 
is to create a special page for this code using other programing 
language and the second option would be to create a link to a web-
page where you would put your code online. We think the first option 
would be the simplest. But it will take a little bit of time as we 
are really busy right now. So we will surely put your code online 
(you can count on us for that) but we are not sure yet. If in the 
meantime you want to go for option 2 we can surely quickly add a ling 
to your web-page.

Thanks again and don't hesitate to get in touch again with us with 
you have new updates. We didn't know about the Bluebottle OS project. 
It's interesting and fun.

the team -
Logged
sage
Full Member
***
Posts: 170



WWW
« Reply #3 on: July 03, 2008, 03:07:42 PM »

Interesting architecture for real-time ray-tracing: http://en.wikipedia.org/wiki/Larrabee_(GPU)  Grin
Logged
soren renner
Global Moderator
Full Member
*****
Posts: 216



« Reply #4 on: July 25, 2008, 07:06:47 PM »

Sage, what about MY raytracer? How come nobody pays any attention to it?
Logged
sage
Full Member
***
Posts: 170



WWW
« Reply #5 on: July 28, 2008, 09:54:57 AM »

Sage, what about MY raytracer? How come nobody pays any attention to it?

You are not exactly right that nobody pays any attention to your ray-tracer. Sven allready ran ray-tracer on 8-core machine:
http://www.ocp.inf.ethz.ch/forum/index.php/topic,29.msg509.html#msg509

By the way, latest news about Larrabee platform:
Larrabee boards coming in November
It will be nice if A2 will be able to use Larrabee's computational power. Probably, allready able because Larrabee has x86 compatible instruction set. Maybe some changes needed in bootstrap code.

As for me:
- if scratch-a-pixel team will publish lessons on Active Oberon it can help to increase Oberon community  Smiley
- do you think if i'll pay attention or not I can strongly change existing situation? I can't involve myself in any project on full-time basis, because I don't have much free time.
- coming Larrabee platform will make photo-realistic rendering real. So, maybe all sort of voxel techniques will be not necessary, because any loss of picture's realistic will reject project by end users. Intel demonstates eye candy ray-traced movies http://www.theinquirer.net/en/inquirer/news/2007/04/23/intel-shows-off-raytraced-quake-4
- coming Larrabee platform is almost the silver bullet  Grin for A2 system to greatly increase community, because it makes high quality 3D graphics real, without proprietary hardware acceleration techniques. I think investigations in that direction is higly desirable  Roll Eyes

« Last Edit: July 28, 2008, 10:48:24 AM by sage » Logged
soren renner
Global Moderator
Full Member
*****
Posts: 216



« Reply #6 on: July 31, 2008, 06:08:14 PM »

sage:
    you are right. We should write from scratch/port a "conventional" tracer to oberon. perhaps you can register at this forum. it is quite interesting.  http://ompf.org/forum
Logged
sage
Full Member
***
Posts: 170



WWW
« Reply #7 on: July 31, 2008, 06:43:30 PM »

perhaps you can register at this forum. it is quite interesting.  http://ompf.org/forum
Cool forum  Wink
Logged
sage
Full Member
***
Posts: 170



WWW
« Reply #8 on: July 31, 2008, 06:50:38 PM »

soren:
  How do you think, maybe on ompf.org allready exists some interesting demos ready to port to A2?
Logged
soren renner
Global Moderator
Full Member
*****
Posts: 216



« Reply #9 on: July 31, 2008, 09:42:04 PM »

Sage: There are certainly demos that you can run -- executable demos for Windows, that I am not in a position to try -- and there is some source code too. I like greenhybrid's project "picogen" and have downloaded the code from its cvs repository. but i think it is not complete or compilable yet.
Logged
soren renner
Global Moderator
Full Member
*****
Posts: 216



« Reply #10 on: July 31, 2008, 09:52:25 PM »

Sage:

http://golly.sourceforge.net/

now THAT is what I call an ALGORITHM!
Logged
soren renner
Global Moderator
Full Member
*****
Posts: 216



« Reply #11 on: July 31, 2008, 11:07:11 PM »

http://www.sci.utah.edu/~wald/Publications/2007///MROct/download//mroct.pdf

Sage: Do you understand this SSE and SIMD stuff? Can you code it?
Logged
soren renner
Global Moderator
Full Member
*****
Posts: 216



« Reply #12 on: August 02, 2008, 08:22:43 PM »

lesson1.Mod compiles and runs under linuxAos 0.8 with the modification: every occurrence of "AosFS" replaced by "Files".
Logged
sage
Full Member
***
Posts: 170



WWW
« Reply #13 on: September 02, 2008, 07:23:58 PM »

Sources for lesson #6 from www.scratchapixel.com now ported.
Logged
sage
Full Member
***
Posts: 170



WWW
« Reply #14 on: September 08, 2008, 11:10:59 AM »

Sage: Do you understand this SSE and SIMD stuff? Can you code it?
I've created some SSE variants of procedures.
For example, dot product:
Code:
PROCEDURE vecDot(VAR c: REAL; CONST a: vector_t; CONST b: vector_t);
BEGIN
c := a.x*b.x + a.y*b.y + a.z*b.z
END vecDot;

PROCEDURE vecDotSSE(VAR c: REAL; CONST a: vector_t; CONST b: vector_t);
CODE {SYSTEM.i386, SYSTEM.SSE}
MOV EBX, c[EBP]
MOV ECX, a[EBP]
MOV EDX, b[EBP]
MOVUPS XMM0, [ECX]
MOVUPS XMM1, [EDX]
MULPS XMM0, XMM1
MOVHLPS XMM1, XMM0
ADDPS XMM0, XMM1
MOVAPS XMM1, XMM0
SHUFPS XMM0, XMM0, 1
ADDPS XMM0, XMM1
MOVSS [EBX], XMM0
END vecDotSSE;
cross product:
Code:
PROCEDURE vecCross(VAR c: vector_t; CONST a: vector_t; CONST b: vector_t);
BEGIN
c.x := a.y * b.z - a.z * b.y;
c.y := a.z * b.x - a.x * b.z;
c.z := a.x * b.y - a.y * b.x
END vecCross;

PROCEDURE vecCrossSSE(VAR c: vector_t; CONST a: vector_t; CONST b: vector_t);
CODE {SYSTEM.i386, SYSTEM.SSE}
MOV EBX, c[EBP]
MOV ECX, a[EBP]
MOV EDX, b[EBP]
MOVUPS XMM0, [ECX]
MOVAPS XMM2, XMM0
MOVUPS XMM1, [EDX]
MOVAPS XMM3, XMM1
SHUFPS XMM0, XMM0, 201
SHUFPS XMM1, XMM1, 210
SHUFPS XMM2, XMM2, 210
SHUFPS XMM3, XMM3, 201
MULPS XMM0, XMM1
MULPS XMM2, XMM3
SUBPS XMM0, XMM2
MOVUPS [EBX], XMM0
END vecCrossSSE;
And because of absence of data alignment and therefore using slow instrustion for loading XMM registers (MOVUPS instrustion) any of perfomance boost did not achieved.

So, for obtaining of significant perfomance boost:
1. much more greater parts of algorythms should be implemented in SSE.
2. data should be aligned. In that case much faster instruction MOVAPS we can use.

PS.
Optimization is a final part of developmen, at first the working code should exist at least.
« Last Edit: September 08, 2008, 11:15:08 AM by sage » Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!