 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
The new docs for PV3.5 contain a tutorial which shows you how to write a
raytracer using POV-Ray's SDL... Far out man! A raytracer simulating a
raytracer!!!
I think I may have just gone one better. Man, I bet someone else has already
done this tho |'-[ What have I done? I've only used the SDL to create an
emulator for an 8-bit computer!!! Yup, write an include file to fill a
region of the "memory" with the correct op-codes, then ask POV-Ray to render
an animation. Between each frame POV-Ray will execute one machine code
instruction.
The actual image that gets rendered is a bunch of 8-segment "LCD" displays.
(The individual segments can be switched on and off by writing the correct
bitmap value into certain memory addresses; memory-mapped I/O baby!) Also at
the bottom of the screen is a dump of the CPU state - PC, SP (and the memory
they point to), status flags and general purpose registers.
As such, the "animation" is actually best viewed as a frame-by-frame slide
show. As you can imagine, since all you're seeing is a page of code numbers
that change now and then, it's actually really hard to follow!!! I'm
thinking if I really wanted to I could create a more graphical illustration
of what's going on. (Would probably still tend to me a bit mesmerising and
require lots of concentration to follow it! LOL)
Why did I do this???
Well, for years I've been having these delusions that one day I will write
my own operating system. Of course, I couldn't possibly write an operating
system for an IBM PC - I simply don't have access to the requisite
information. I don't even know Intel assembly! Never mind all the different
protocols and chipsets for I/O... It's simply beyond my abilities. But one
of my other "lifetime ambitions" is to build my own computer - out of
individual logic gates! Of course, I haven't managed to do that yet
either... So now I'm building an emulator! At least now I can get
programming while I wait for the computer to take shape... (Hey, I could
even emulate the logic gates, couldn't I??? Mmmm....)
I actually have a C64 emulator... But I don't like some of the way the 6502
works... So I designed my own microprocessor. And now I can emulate it!
Yay!!!
[Aside] So am I completely nuts? Opinions? [/Aside]
Anyway, will post the sources - if anyone besides me actually gives a sod
that is! They're kinda big (POV-Ray works out what to do with each op-code
using a MASSIVE #switch statment - and the instruction set is about 90
codes!) But hey, there's always WinZIP (if folks have that or equivelent).
It's very uncommented ("hey, *I* know what I'm doing...") and probably still
very buggy ("oops - look at that; I got the address and data the wrong way
round...") but hey ;-)
The biggest "program" I've written so far is about 30 instructions. The
first part adds two numbers together, and the second part (the big bit!) is
a subroutine that takes a number is displays (in hex) on the 8-segment
display. So... in other words, with 30 instructions of code, you get the
same printout every time. *sigh* But hey, if you changed just 2 bytes, you
could change the output... Ah forget it! 8¬P
Knackered.
Andrew.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> The new docs for PV3.5 contain a tutorial which shows you how to write a
> raytracer using POV-Ray's SDL... Far out man! A raytracer simulating a
> raytracer!!!
>
> I think I may have just gone one better. Man, I bet someone else has already
> done this tho |'-[ What have I done? I've only used the SDL to create an
> emulator for an 8-bit computer!!!
I think this is more useful than the tutorial project (as a project
that is, not as a tutorial). Imagine you want to render an animation
of an arcade hall. Instead of pre-calculating animations that you
display on the arcade machines' screens you can use the parser to
calculate what is on screen and even let it interact with the
animation's characters. All you need is the arcade machine's or home
computer's ROM image. Very useful. On the other hand I find a
raytracer implemented in SDL not very persuasive. What would make
sense is a raytracer implemented in the home computer's machine code...
--
merge{#local i=-11;#while(i<11)#local
i=i+.1;sphere{<i*(i*i*(.05-i*i*(4e-7*i*i+3e-4))-3)10*sin(i)30>.5}#end
pigment{rgbt 1}interior{media{emission x}}hollow}// Mark Weyer
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> I think this is more useful than the tutorial project (as a project
> that is, not as a tutorial). Imagine you want to render an animation
> of an arcade hall. Instead of pre-calculating animations that you
> display on the arcade machines' screens you can use the parser to
> calculate what is on screen and even let it interact with the
> animation's characters.
Yeah... hadn't thought of that... Interesting idea.
> All you need is the arcade machine's or home
> computer's ROM image. Very useful.
Well... at the moment, it doesn't emulate any piece of hardware that has
ever actually existed - i.e., it doesn't emulate a C64 or a ZX Spectrum or
anything in particular, just an imaginary machine that I invented. (No
reason why such a device COULDN'T exist, it's just that I haven't built one
yet ;-) To actually make use of a ROM image (wouldn't there be copyright
issues?) it would have to actually emulate a real computer - the one the ROM
works on! But still, a neat idea...
> On the other hand I find a
> raytracer implemented in SDL not very persuasive. What would make
> sense is a raytracer implemented in the home computer's machine code...
Mmm... now there's tempting! ;-)
(Did I mention that this thing is 8-bit, with no hardware support for
floating point operations?!?)
Andrew.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
The obvious next step: port MAME to SDL.
;-)
"Andrew Coppin" <orp### [at] btinternet com> wrote in message
news:3e71009b@news.povray.org...
> > I think this is more useful than the tutorial project (as a project
> > that is, not as a tutorial). Imagine you want to render an animation
> > of an arcade hall. Instead of pre-calculating animations that you
> > display on the arcade machines' screens you can use the parser to
> > calculate what is on screen and even let it interact with the
> > animation's characters.
>
> Yeah... hadn't thought of that... Interesting idea.
>
> > All you need is the arcade machine's or home
> > computer's ROM image. Very useful.
>
> Well... at the moment, it doesn't emulate any piece of hardware that has
> ever actually existed - i.e., it doesn't emulate a C64 or a ZX Spectrum or
> anything in particular, just an imaginary machine that I invented. (No
> reason why such a device COULDN'T exist, it's just that I haven't built
one
> yet ;-) To actually make use of a ROM image (wouldn't there be copyright
> issues?) it would have to actually emulate a real computer - the one the
ROM
> works on! But still, a neat idea...
>
> > On the other hand I find a
> > raytracer implemented in SDL not very persuasive. What would make
> > sense is a raytracer implemented in the home computer's machine code...
>
> Mmm... now there's tempting! ;-)
>
> (Did I mention that this thing is 8-bit, with no hardware support for
> floating point operations?!?)
>
> Andrew.
>
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> The obvious next step: port MAME to SDL.
Port whatty?!?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Andrew Coppin wrote:
>> The obvious next step: port MAME to SDL.
>
>Port whatty?!?
>
MAME = Multi Arcade Machine Emulator
I haven't used it personally, but it's supposed to be really good. I've
heard there are even ports of it for several consoles.
Well, here's something even loonier than making an emulator in SDL: Make a
whole game in it. Just imagine Warcraft III or Duke3d with raytraced
graphics! Drool drool drool! Pity, no current computer is fast enough to do
it in real time.
I suppose you could write a game engine that uses raytracing for the
graphics, but it would probably take 10-20 years before there is a computer
fast enough to run it at 60fps.
I've certainly been thinking about doing it, _IF_ I ever get my programming
skills up to the required level to do it (currently I'm just bordering on
being able to write Tetris).
In the mean time, perhaps you could write POV-Tetris, eh? :-)
Rohan _e_ii
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Wed, 19 Mar 2003 20:54:17 EST, Rohan Bernett wrote:
> Andrew Coppin wrote:
>>> The obvious next step: port MAME to SDL.
>>
>>Port whatty?!?
>>
>
> MAME = Multi Arcade Machine Emulator
>
> I haven't used it personally, but it's supposed to be really good. I've
> heard there are even ports of it for several consoles.
>
> Well, here's something even loonier than making an emulator in SDL: Make a
> whole game in it. Just imagine Warcraft III or Duke3d with raytraced
> graphics! Drool drool drool! Pity, no current computer is fast enough to do
> it in real time.
>
> I suppose you could write a game engine that uses raytracing for the
> graphics, but it would probably take 10-20 years before there is a computer
> fast enough to run it at 60fps.
>
> I've certainly been thinking about doing it, _IF_ I ever get my programming
> skills up to the required level to do it (currently I'm just bordering on
> being able to write Tetris).
>
> In the mean time, perhaps you could write POV-Tetris, eh? :-)
>
> Rohan _e_ii
What are you talking about? Real-time raytracing is here! There's a pretty
impressive RTRT demo called Heaven 7
(ftp://ftp.scene.org/pub/parties/2000/mekkasymposium00/in64/h7-final.zip).
Considering that hardware acceleration makes any kind of graphics many
times faster, hardware accelerated real-time raytracing is a distinct
possibility right now! OpenRT (similar to OpenGL) is being developed right
now. (http://www.openrt.de/) Sure hope PC hardware manufacturers catch on
and make hardware accelerators for it.
--
light_source#macro G(E)sphere{z+E*y*5e-3.04rotate-z*E*6pigment{rgbt#end{
20*y-10#local n=162;1}#while(n)#local n=n-.3;G(n)x}}G(-n).7}}#end//GregE
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
>What are you talking about? Real-time raytracing is here! There's a pretty
>impressive RTRT demo called Heaven 7
>(ftp://ftp.scene.org/pub/parties/2000/mekkasymposium00/in64/h7-final.zip).
>Considering that hardware acceleration makes any kind of graphics many
>times faster, hardware accelerated real-time raytracing is a distinct
>possibility right now! OpenRT (similar to OpenGL) is being developed right
>now. (http://www.openrt.de/) Sure hope PC hardware manufacturers catch on
>and make hardware accelerators for it.
If it's possible to do real-time raytracing, then why can't we do it with
POVRay, hmm?
Rohan _e_ii
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <np2### [at] 40tude net>,
Greg Edwards <edw### [at] hotmail comremovethis> wrote:
> What are you talking about? Real-time raytracing is here! There's a pretty
> impressive RTRT demo called Heaven 7
> (ftp://ftp.scene.org/pub/parties/2000/mekkasymposium00/in64/h7-final.zip).
> Considering that hardware acceleration makes any kind of graphics many
> times faster, hardware accelerated real-time raytracing is a distinct
> possibility right now! OpenRT (similar to OpenGL) is being developed right
> now. (http://www.openrt.de/) Sure hope PC hardware manufacturers catch on
> and make hardware accelerators for it.
RTRT is still very limited. You have to make a lot of compromises in
features and realism to get anything close to a tolerable resolution and
frame rate. A highly tweaked and tuned demo is very different from a
detailed game environment.
And yes, it can be accelerated...with hardware designed to accelerate
it. And even then, there are limitations. Besides which, it doesn't
exist comercially yet...
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <web.3e791f49528171f8d02c7b870@news.povray.org>,
rox### [at] yahoo com says...
> Andrew Coppin wrote:
> >> The obvious next step: port MAME to SDL.
> >
> >Port whatty?!?
> >
>
> MAME = Multi Arcade Machine Emulator
>
> I haven't used it personally, but it's supposed to be really good. I've
> heard there are even ports of it for several consoles.
>
Good is an understatement. It supports virtually every game ever made,
save for the newer vector based ones. Most that don't work are do to
there being no good dumps of the original roms. Best to get the DOS
version for full compatibility though and a version like Mame32 for
playing the ones that will work in it, which should be 100% of them 'if'
you have the right sets of rom images. Since version .32 that I used to
have, they moved a lot of the rom images that 'used' to be built into the
emulator out to the various rom files, this means they won't work with
the new Mame32 and probably not for Mame 0.66 either unless patched
first. I had to fix about 10 of the 100 or so I had, including spyhunter
because the files I had didn't contain the needed images. At least one of
the roms I have crashes, so some issues do exist, at least between v 0.32
and v 0.66, but that is the only one out of all the ones I have.
Unfortunately, while www.mame.dk is still a good place to check out for
the data on supported games (and missing rom images), you have to get the
roms themselves from other places. There is a mess of them on the WinMX
and opennap networks though, including entire archives of different
groups, like everything starting with A, etc. Also, www.romnation.net is
good, but their auto redirect for file downloads sometimes screws up for
me.
Patches to upgrade the roms to the 'new' versions are from another site
http://www.sys2064.com/fixfiles.htm. Though these are not 100% complete
with all the needed patches. I had to get one file for Spyhunter from
another rom that had it, however the patch that was included for it also
proved necessary to get it to work right. If you can find such patches on
P2P networks, then good luck trying to figure out what to search on. I
didn't see any of them when I tried to look.
Also, some people have even build arcade cabinets to hold their computers
and monitors, then wired in the original arcade controls to them.
Thus assumes anyone even cares. ;) lol
--
void main () {
If Schrödingers_cat is alive
call functional_code()
else
call crash_windows();
}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <web.3e7a64b3528171f8d02c7b870@news.povray.org> , "Rohan Bernett"
<rox### [at] yahoo com> wrote:
> If it's possible to do real-time raytracing, then why can't we do it with
> POVRay, hmm?
Who says you can't?
Thorsten
____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povray org
I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
If you want to create your own CPU on silicon, then you should have a
look at either VHDL or Verilog. This are languages used to design
hardware. You can use Xilinx tools and FPGA technology to realise this.
There are loads of tutorials and on the web and books that teach how to
design a CPU with either VHDL or Verilog. In fact, I think there is a
guy that created a complete NES system with Verilog.
Have a look at http://www.xilinx.com
You are going to find all the information there about their tools and
languages.
Since I was a kid I always wanted to create my own electronic devices.
So I started teaching myself electronics. I also took a course in
Electronics and a degree in computer engineering, which covered all the
electronics I needed to fulfil my dreams. Up until now I have designed
an 8-bit CPU similar to the 6502 using VHDL and FPGA technology, a
couple of alarm systems, music amplifiers, etc.... My next goal will be
to design a hardware based raytracer. I don't really have the time now,
but one day I will.
As for you project, I think it was a good idea to generate the stuff
with povray.
All the best
Fidel.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Rohan Bernett wrote:
> Andrew Coppin wrote:
>
>>>The obvious next step: port MAME to SDL.
>>
>>Port whatty?!?
>>
>
>
> MAME = Multi Arcade Machine Emulator
>
> I haven't used it personally, but it's supposed to be really good. I've
> heard there are even ports of it for several consoles.
>
> Well, here's something even loonier than making an emulator in SDL: Make a
> whole game in it. Just imagine Warcraft III or Duke3d with raytraced
> graphics! Drool drool drool! Pity, no current computer is fast enough to do
> it in real time.
SDL is not a 3D engine nor a drawing API. It is mostly used as an
alternative to directx, but that works on several platforms.
To render 3D stuff, you need OpenGL. I don't know if the Windows version
does support Direct3D as well, but the Mac version, which is the one I
am using, only supports opengl because Direct3D is a Microsoft thing.
As for making the games, I don't quite understand what you are trying to
say. There are loads of games written in SDL. But this are tile based
games. For 3D games they use opengl for the rendering side of it and SDL
is used for the sound, keyboard, joystick, system initialisation, etc...
There is a version of Tron which uses SDL and OpenGL. Just have a look
around the web.
As for MAME it is implemented in SDL (at least the Mac version is).
As for the raytraced thing. There are loads of games that use real-time
raytracing. Have a look on the web and you'll see.
All the best
Fidel.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
fidel viegas wrote:
>
>
> Rohan Bernett wrote:
>
>> Andrew Coppin wrote:
>>
>>>> The obvious next step: port MAME to SDL.
>
> As for MAME it is implemented in SDL (at least the Mac version is).
>
SDL as in "Scene Description Language" and not "Simple Device Layer"
(right?).
/Nathan
> As for the raytraced thing. There are loads of games that use real-time
> raytracing. Have a look on the web and you'll see.
>
> All the best
>
> Fidel.
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Nathan Letwory wrote:
> SDL as in "Scene Description Language" and not "Simple Device Layer"
> (right?).
Oh, now I got confused. Were you guys talking about povray SDL or SDL
(Simple DirectMedia Layer)?
If it was povray SDL, then what I have said doesn't apply.
All the best
Fidel
PS:There are so many SDL nomenclatures that I get confused.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> Have a look at http://www.xilinx.com
Hey, cool. Thanks - will take a look.
> Since I was a kid I always wanted to create my own electronic devices.
> So I started teaching myself electronics. I also took a course in
> Electronics and a degree in computer engineering, which covered all the
> electronics I needed to fulfil my dreams. Up until now I have designed
> an 8-bit CPU similar to the 6502 using VHDL and FPGA technology, a
> couple of alarm systems, music amplifiers, etc.... My next goal will be
> to design a hardware based raytracer. I don't really have the time now,
> but one day I will.
Glad I'm not the only crazy person on this earth ;-)
> As for you project, I think it was a good idea to generate the stuff
> with povray.
Yeah, building hardware is fun, but software is way more convinient...
Especially for testing!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Patrick Elliott wrote:
>Also, some people have even build arcade cabinets to hold their computers
>and monitors, then wired in the original arcade controls to them.
Yeah. I've seen photos of some impressive cabinents some people have built
in the HotBox section in Atomic. I don't think I could make one myself,
though.
>void main () {
> If Schrödingers_cat is alive
> call functional_code()
> else
> call crash_windows();
>}
Heh Heh Heh. I like it, I like it. :-) Seems quite appropriate to WinME,
judging by the trouble dad had with it until he got rid of the stupid
thing.
Rohan _e_ii
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Andrew Coppin wrote:
> Glad I'm not the only crazy person on this earth ;-)
I wouldn't say crazy because the CPU I did was an assignment for the
advanced digital design module.
>>As for you project, I think it was a good idea to generate the stuff
>>with povray.
>
>
> Yeah, building hardware is fun, but software is way more convinient...
> Especially for testing!
With VHDL you write your hardware with software. Then there are two ways
of writing programs in VHDL, one is for testing purposes, which works
pretty much like your emulator written in c or c++, but it runs
concurrently and it has got timers, etc... The other program you write
is for the actual generation of the hardware. You create an interface,
which tells how the your device is composed inside and then you write a
behavioural model to test the funcionality of the circuit and once it is
working to your satisfaction, then you write the architecture module
which is where you connect all the circuitry. Once you compile it, your
compiler will generate logic gates interconnected to generate your
circuit. Then you just transfer that to an FPGA IC and that's it. you
are done.
Anyway, keep up with your inventions. Have you got screenshots of your
povray renderings?
All the best
Fidel.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> > Glad I'm not the only crazy person on this earth ;-)
>
> I wouldn't say crazy because the CPU I did was an assignment for the
> advanced digital design module.
Ah... That would make more sense ;-)
> > Yeah, building hardware is fun, but software is way more convinient...
> > Especially for testing!
>
> With VHDL you write your hardware with software. Then there are two ways
> of writing programs in VHDL, one is for testing purposes, which works
> pretty much like your emulator written in c or c++, but it runs
> concurrently and it has got timers, etc...
Sounds really cool... I gotta check this out... (Oh yeah - I said that
yesterday too, didn't I? I'm a busy person sadly....)
> Once you compile it, your
> compiler will generate logic gates interconnected to generate your
> circuit. Then you just transfer that to an FPGA IC and that's it. you
> are done.
So you mean if I buy the right stuff I can actually have running silicon???
(Well, actually it's Germanium these days isn't it? Or is it? I have no idea
really...)
> Anyway, keep up with your inventions. Have you got screenshots of your
> povray renderings?
I do have images - they're not terribly exciting tho. Will post one in a
sec. Also note that I've got a (unfinished) logic diagram currently on
povray.binaries.images. (Took me hours - I think I'm doing it the hard way!
Will investigate easier methods ;-)
Thanks!
Andrew.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Andrew Coppin wrote:
>>With VHDL you write your hardware with software. Then there are two ways
>>of writing programs in VHDL, one is for testing purposes, which works
>>pretty much like your emulator written in c or c++, but it runs
>>concurrently and it has got timers, etc...
>
>
> Sounds really cool... I gotta check this out... (Oh yeah - I said that
> yesterday too, didn't I? I'm a busy person sadly....)
If you are based in London, then try to check this bookcase shops around
oxford circus and you may find books on hardware design for about £3.99.
I got one on verilog and it comes with the foundation tools. Then you
need to buy the actual programmer device and the appropriate FPGA chip
for you project.
>>Once you compile it, your
>>compiler will generate logic gates interconnected to generate your
>>circuit. Then you just transfer that to an FPGA IC and that's it. you
>>are done.
>
>
> So you mean if I buy the right stuff I can actually have running silicon???
>
> (Well, actually it's Germanium these days isn't it? Or is it? I have no idea
> really...)
Yep, you can have the whole NES system on a single chip. (this includes
the graphics processor or PPU (pixels processing unit) as it is called.)
All the best
Fidel.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> If you are based in London, then try to check this bookcase shops around
> oxford circus and you may find books on hardware design for about £3.99.
> I got one on verilog and it comes with the foundation tools. Then you
> need to buy the actual programmer device and the appropriate FPGA chip
> for you project.
I'm not based in London, but I can get there ;-) Might be easier to check my
local bookstores tho (or even Amazon).
I now have broadband :-)
[Aren't birthdays wonderful?]
Anyway, on the Xilinx website, you can download a thingy called ISE WebPACK
for free apparently. I don't follow most of the jargon, so I don't know what
it does... I get the impression that this thing will actually allow you to
design stuff - the idea being that you'll then have to pay "real money" for
the equiptment to put it into hardware.
> > So you mean if I buy the right stuff I can actually have running
silicon???
>
> Yep, you can have the whole NES system on a single chip. (this includes
> the graphics processor or PPU (pixels processing unit) as it is called.)
You know a lot about this stuff, don't ya? (Oh yeah - you did a course. Ok,
ok, I'm stupid...)
Basically, I know - theoritically - how a logic gate works. I also built
stuff out of 7400 chips (if you happen to know what that means). Actually, a
while back a bought a whole load of them, but suddenly I can't seem to get
them to work properly. (It's been a while.)
Anyway, drifting somewhat off-topic here...
Thanks a lot!
Andrew.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |