Genny and 3D
Moderator: BigEvilCorporation
Genny and 3D
OMG !!!
I've tried to plot a pixel all the day long (my boss won't be happy !) and ... nothing ! drawing a single plot takes me 350 cycles, with some bugs still, and I'm far, very far indeed from Stef demo (man! 10fps with the cube)
Guess I have missed something ...
I'll post later.
I've tried to plot a pixel all the day long (my boss won't be happy !) and ... nothing ! drawing a single plot takes me 350 cycles, with some bugs still, and I'm far, very far indeed from Stef demo (man! 10fps with the cube)
Guess I have missed something ...
I'll post later.
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Megadrive hardware is really not designed for 3D rendering nor than bitmap drawing...
for drawing a single pixel, you have to convert your bitmap coordinat in tile coordinate, then write mode access and adress to the VDP port, then write your pixel data. That's definitly not a fast way for drawing pixel but with this hardware, you don't have choice.
For my 3D rendering, i used a bitmap buffer located in main ram and i convert it to tiles during VRAM transfert. For many pixel drawing, it's the fastest method i think
for drawing a single pixel, you have to convert your bitmap coordinat in tile coordinate, then write mode access and adress to the VDP port, then write your pixel data. That's definitly not a fast way for drawing pixel but with this hardware, you don't have choice.
For my 3D rendering, i used a bitmap buffer located in main ram and i convert it to tiles during VRAM transfert. For many pixel drawing, it's the fastest method i think
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
You may want to examine how Duke3D, Zero Tolerance or Bloodshot works. These are fine raycasters made for MD and run quite fast
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
Here we go with flat shading.
Step 1 is a projection with trigonometry.
Step 2 is getting 2D cartesian equation, using divisons and remainings
Step 3 is just a graphical library consideration
Step 4 is getting 3D cartesian equation, using divisions and remainings.
Step 5 is making a normal product, using multipy and adds
Step 6 is only a Color Look-Up Table (CLUT).
Step 7 is quite compute hungry. I am currently working on it.
- 1- Transform vertices (3D points) into pixels (2D points)
2- get lines (step 1 needed)
3- transform lines into polygon (step 2 needed)
4- get 3D vectors
5- compute the normal to the vectors (step 4 needed)
6- get color from the normal (step 5 needed)
7- for all the polygon points, plot them with the color (step 3 an 6 needed).
Step 1 is a projection with trigonometry.
Step 2 is getting 2D cartesian equation, using divisons and remainings
Step 3 is just a graphical library consideration
Step 4 is getting 3D cartesian equation, using divisions and remainings.
Step 5 is making a normal product, using multipy and adds
Step 6 is only a Color Look-Up Table (CLUT).
Step 7 is quite compute hungry. I am currently working on it.
Well, i have a trick to render vertical lines (half horizontal rez only) at full speed...
Just put your tiles like that (for a display size of 4 tiles height)
0 4 8 12
1 5 9 ....
2 6 10
3 7 11
Then, just render your pixels as Bytes and increase the adress per 4 after each write, and DMA all to vram at once... (or set the VDP data bias to 0x4 to render directly in vram). You get ultra fast vertical line drawing...
Héhé, stef can confirm from what he saw
Btw: Yeah, Toystory and Blood shot do mirror
Just put your tiles like that (for a display size of 4 tiles height)
0 4 8 12
1 5 9 ....
2 6 10
3 7 11
Then, just render your pixels as Bytes and increase the adress per 4 after each write, and DMA all to vram at once... (or set the VDP data bias to 0x4 to render directly in vram). You get ultra fast vertical line drawing...
Héhé, stef can confirm from what he saw
Btw: Yeah, Toystory and Blood shot do mirror
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
My software BMP2Tile is almost as fast than a simple software copy.
Anyway a DMA copy is a lot faster than a software copy. But i've to admit i don't understand your method exactly. I just can't use DMA to transform my bitmap buffer to tile buffer in VRAM... actually i can, but i've to do severals transferts and transfert 2x the total size, so all gains are lose :-/
Anyway a DMA copy is a lot faster than a software copy. But i've to admit i don't understand your method exactly. I just can't use DMA to transform my bitmap buffer to tile buffer in VRAM... actually i can, but i've to do severals transferts and transfert 2x the total size, so all gains are lose :-/
Star Cruiser intro (Megadrive)
http://www.youtube.com/watch?v=MIMEfxYh3lc
http://www.youtube.com/watch?v=MIMEfxYh3lc
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Intro is very nice. I never thought that MD is fast enough to create such complex 3D objects.stalepie wrote:Star Cruiser intro (Megadrive)
http://www.youtube.com/watch?v=MIMEfxYh3lc
Well, I'm not sure, but game itself uses raycasting. Edit: No raycasting, 3D objects all the way.
Last edited by TmEE co.(TM) on Sat Dec 16, 2006 11:10 am, edited 1 time in total.
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
Amazing !stalepie wrote:Star Cruiser intro (Megadrive)
http://www.youtube.com/watch?v=MIMEfxYh3lc
That is impressive. It's definately not updating the 3D at 30 frames per second though.
I thought they were rendering to a sprite, until I saw the large object come in on the right. Too bad the in game stuff doesn't look as good.
Silpheed is the best looking 3D on the Genesis, but that is helped a lot by the Sega CD processor, I believe.
Using the Sega CD, I wonder if the Sub CPU could handle all of the rotation and translation, and the Main CPU handle the rendering?
I thought they were rendering to a sprite, until I saw the large object come in on the right. Too bad the in game stuff doesn't look as good.
Silpheed is the best looking 3D on the Genesis, but that is helped a lot by the Sega CD processor, I believe.
Using the Sega CD, I wonder if the Sub CPU could handle all of the rotation and translation, and the Main CPU handle the rendering?
-
- Very interested
- Posts: 615
- Joined: Thu Nov 30, 2006 6:30 am
I would imagine that it used the Sega CD graphics chip for the bulk of the rendering. AFAIK, you can do multiple deformed sprite renders to the same buffer. Of course, the 68ks still need to handle the 3D and 3D to 2D transforms.cdoty wrote:Silpheed is the best looking 3D on the Genesis, but that is helped a lot by the Sega CD processor, I believe.
Using the Sega CD, I wonder if the Sub CPU could handle all of the rotation and translation, and the Main CPU handle the rendering?