r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[rebcode] Rebcode discussion

Henrik
13-Dec-2005
[1391]
or, we have . notation: PICK.T
Ashley
13-Dec-2005
[1392]
tick and toke? ;)
Geomol
14-Dec-2005
[1393x2]
Hmm, now I think about it once more, maybe a special PICK isn't needed. 
The internal representation of values, whether they are seen as integers 
or tuples, can be the same. If we name each of the components of 
a 4 part tuple red, green, blue and alpha, the following holds:

integer = (alpha * (2 ** 24)) + (red * (2 ** 16)) + (green * (2 ** 
8)) + blue

What we need, is the ability to tell values as tuples as well as 
integers. Internal they are the same. I would like to be able to 
do this:
poke img 1 16843009
poke img 1 1.1.1.1
pick result img 1
eq.i result 16843009
eq.i result 1.1.1.1
But again, it might hit performance too much, because the parser 
needs to check, if an integer is written as an integer or as a tuple.
Pekr
14-Dec-2005
[1395]
special opcodes wouldn't hurt imo .....
Volker
14-Dec-2005
[1396]
pick.byte?
Geomol
2-Apr-2006
[1397x2]
I've made a test of a voxel landscape engine in rebcode. As I did 
it on my Mac, it's written in the version of rebcode found in the 
version 1.3.50 of REBOL/View from around Oct-2005. I haven't tested 
it with the Windows version of View, but I guess, it should work 
with that same version 1.3.50. I first did a plain REBOL version 
and got a framerate of around 3-4 fps (frames pr. second). With the 
rebcode version, I get around 20 fps. The script is found here: http://home.tiscali.dk/john.niclasen/voxel/NicomVoxel.r


I've also made a snapshot here: http://home.tiscali.dk/john.niclasen/voxel/snapshot.png
In case someone is interested in trying the script out, you can move 
around with w, s, a and d.
Henrik
2-Apr-2006
[1399]
I get a bug:

>> do http://home.tiscali.dk/john.niclasen/voxel/NicomVoxel.r
connecting to: home.tiscali.dk
Script: "NicomVoxel" (2-Apr-2006)
** User Error: Rebcode syntax error:
mul idx cZ
add idx cX
pickz OldY heightmap idx
** Near: make error! reform [msg copy/part mold/only where 50]
Geomol
2-Apr-2006
[1400]
Henrik, do you use the version 1.3.50 of View? ;-)
Henrik
2-Apr-2006
[1401]
1.3.61
Geomol
2-Apr-2006
[1402x3]
That one have a newer version of rebcode, use the old one.

For Mac, use: http://www.rebol.net/builds/024/rebview1350024.tar.gz

For Windows, I guess this will work: http://www.rebol.net/builds/031/rebview1350031.exe
has
For people with Linux, maybe this will work: http://www.rebol.net/builds/042/rebview1350042.tar.gz
(I don't know, if that include rebcode!?)
Henrik
2-Apr-2006
[1405]
works now. 33-50 fps
Geomol
2-Apr-2006
[1406]
wow! :) What hardware?
Henrik
2-Apr-2006
[1407]
2.6 Ghz celeron PC. interesting since this PC is usually very slow 
for rebol graphics
Geomol
2-Apr-2006
[1408]
ok, I get 20 fps on a 1.2 GHz G4 Mac.
Henrik
2-Apr-2006
[1409x2]
seems about right clock for clock
in your screenshot the sky is grey but it's white here?
Geomol
2-Apr-2006
[1411x2]
How many RHz do you get with: http://www.rebol.com/speed.r
The snapshot may have been done with a slightly different version. 
I play with the colours.
Henrik
2-Apr-2006
[1413]
Console:   0:00:12.979 - 39 KC/S
Processor: 0:00:00.801 - 1078 RHz (REBOL-Hertz)
Memory:    0:00:02.023 - 23 MB/S
Disk/File: 0:00:00.991 - 30 MB/S
Geomol
2-Apr-2006
[1414]
I get around 760 RHz
Henrik
2-Apr-2006
[1415]
which terminal program do you use?
Geomol
2-Apr-2006
[1416]
So, makes sence.
Henrik
2-Apr-2006
[1417]
I get 345 on the mac
Geomol
2-Apr-2006
[1418]
The standard Terminal incl. in MacOSX
Henrik
2-Apr-2006
[1419x2]
same here
but...
Geomol
2-Apr-2006
[1421]
Maybe you have some background program running on the mac stealing 
CPU?
Henrik
2-Apr-2006
[1422]
I get 222 kc/s in the OSX console, where the Windows console only 
gives 39 kc/s
Geomol
2-Apr-2006
[1423]
Computers are strange and difficult to compare. :)
Henrik
2-Apr-2006
[1424x3]
there is something that massively slows down the console under windows. 
I get the same slowness under View with most programs.
testing the same programs under slower PC's yield better results 
than this one
strangly it seems I'm the only one with this problem. I've talked 
a lot about how slow SHOW is, but it seems to be unique to this PC
Geomol
2-Apr-2006
[1427]
I use SHOW in the voxel program.
Henrik
2-Apr-2006
[1428]
it's not really visible on small windows, but fullscreen stuff is 
at least 10-25 times slower
Geomol
2-Apr-2006
[1429]
Maybe some bottleneck somewhere.
Henrik
2-Apr-2006
[1430x2]
I get 13-15 fps on the mac
what graphics card does your mac have?
Geomol
2-Apr-2006
[1432]
ATI 32MB AGP, chipset: ATY,RV280M9+ (It's an iBook).
Henrik
2-Apr-2006
[1433]
mac mini here... seems to be close to the same specs
Geomol
2-Apr-2006
[1434]
ATI Mobility Radeon 9200
Henrik
2-Apr-2006
[1435x2]
same
it's probably the modem. for some reason it constantly eats 25% cpu
Robert
3-Apr-2006
[1437]
Hey, that's cool. I get 33.3 FPS.

Console:   0:00:01.082 - 467 KC/S
Processor: 0:00:00.501 - 1724 RHz (REBOL-Hertz)
Memory:    0:00:01.091 - 43 MB/S
Disk/File: 0:00:00.471 - 64 MB/S
Geomol
3-Apr-2006
[1438x3]
:-)
To new readers:

We're testing this Voxel Landscape script, I've made in rebcode: 
http://home.tiscali.dk/john.niclasen/voxel/NicomVoxel.r

Too see what it is, screengrab is here: http://home.tiscali.dk/john.niclasen/voxel/snapshot.png

You need View 1.3.50 to run it:
Windows: http://www.rebol.net/builds/031/rebview1350031.exe
Mac OSX: http://www.rebol.net/builds/024/rebview1350024.tar.gz
Linux: http://www.rebol.net/builds/042/rebview1350042.tar.gz
Use w, s, a and d to move around.