Page 2 of 3

Posted: Mon Feb 19, 2007 9:49 pm
by Fonzie
Arent those "polygon crossing" only done by hardware rendering?
I mean, it requires too much software (Require a Zpixel map) for manual rendering.

My point of view would be to render per group of polygons only (group car, group house, group tree, group map).
Using a Zbuffer per group (polygons) and a global Zbuffer for the groups :P

Also, the trick is to put the houses few px flying on the map to avoid any suddently house disparition under the map (due to bad zbuffer approx).

Well, that's for the exemple of a green outdoor map and houses :P

Posted: Mon Feb 19, 2007 11:52 pm
by Stef
As said Fonzie, it's too much for software. The easy Z buffer method is also a big overhead compared to classic rendering. Generally we calculate the Z value on a triangle base and just ignore triangle intersection stuff. We can do some complex intersection code which cut triangle in severals ones but it's complex and still heavy for the CPU.

There are many ways of rendering a 3D scene. The scanline method offers a good level of accuracy (they can handle intersection easily) and can be faster for complexe scene. But you need to be familiar with 3D rendering as this method is more complexe.

http://en.wikipedia.org/wiki/Scanline_r ... _Rendering

This link just list some software 3D engine, maybe it can be a good source of informations for you :
http://cg.cs.tu-berlin.de/~ki/3del_1419 ... _span.html

Posted: Tue Feb 20, 2007 5:42 am
by ob1
Stef wrote:As said Fonzie, it's too much for software.
Thank you guys.
Well, it'll save me some hundreds hours of computing, that's true !
I've been off for a little, and will still be the couple of coming days. We're releasing a new version of our software, and since I am desperately late (thank you 32x !!!), it's a great piece of work I have to furnish !

Posted: Sun Feb 25, 2007 9:36 pm
by ob1
Hi you guys.
It seems forever to me I didn't post here.
First of all, let me congratulate Kan and Steph' for making KMod 0.7 possible.
Here I am striking back. Your remember ? I want to use the 32X as a video card for the genny.

I use the Comm Port as a bus between the 2 systems :
Offset 0h : STATUS. Indicates the state of the Comm Port : who can write, who can read, ...
2h : CTRL. Tells the 32X what function to execute : empty the Frame Buffer, allocate a vertex, draw a triangle, ...
4h to Ch : DATA0 to DATA4. Used for the functions. You'd guess that a function drawing a triangle will need 3 vertex for the triangle to be drawn.
Eh : RESULT. Sometimes, the 32X can gives some results back. I don't see anything more than allocate : the 68k asks the 32X to allocate a vertex. The 32X gives the address back, so that 68k and 32X could speak of the same vertex.

The Comm Port has five states :
WRITE_ME. The 68k can write to the Comm Port.
WRITING. The 68k is writing to the Comm Port.
READ_ME. The Comm Port can be read by one SH2.
READING_M. The Master SH2 is reading the Comm Port.
READING_S. The Slave SH2 is reading the Comm Port.

Here's the code for the 68k to write something to the Comm Port :

Code: Select all

void putVDP(int ctrl, int data0, int data1, ...) {
	while (COMM_PORT(STATUS) != WRITE_ME) ;
	COMM_PORT(STATUS) = WRITING;
	COMM_PORT(CTRL) = ctrl;
	COMM_PORT(DATA0) = data0;
	COMM_PORT(DATA1) = data1;
		// wriesg others DATA
	COMM_PORT(STATUS) = READ_ME;
}
Here's the code for the Master SH2 to read something from the Comm Port :

Code: Select all

void readVDP() {
	int entrance = 1;
	int instr;
	int data0;
	int data1;
	/* Wait for READ_ME, than, wait for READING_M. Between READ_ME and
	setting READING_M, the Slave SH2 may have written READING_S	*/
	while (entrance | COMM_PORT(STATUS)==READING_M) {
		entrance = 0;
		while (COMM_PORT(STATUS) != READ_ME) ;
		COMM_PORT(STATUS) = READING_M;
	}
	instr = COMM_PORT(CTRL);
	data0 = COMM_PORT(DATA0);
	data1 = COMM_PORT(DATA1);
		// read others DATA
	COMM_PORT(STATUS) = WRITE_ME;
}
I could do the same for the slave SH2, but I rather re-use this bit of code. It will help the lisibility and the maintainability of the program. I can tell each SH2 if it's Master of Slave. All I have to do, is set a bit that just them will know : in private Work RAM for example. So, I set the cache as 2 way, for each SH2, and, at their own C000 0000h, I write respectively READING_M and READING_S. In the ROM, at 3E0h and 3E4h, there are the Master and Slave Start Address. Here's a SH2 bootstrap :

Code: Select all

READING_M	equ	3
READING_S	equ	4
MASTER_INIT:
; set cache as 2way
	MOV	READ_STATUS,R1
	MOV	READING_M,@R1
	BRA	MAIN
SLAVE_INIT:
; set cache as 2way
	MOV	READ_STATUS,R1
	MOV	READING_S,@R1
	BRA	MAIN
READ_STATUS:
	dc.l	$C0000000
MAIN:
; 32X SH2 main code
The code for reading becomes, for each SH2 :

Code: Select all

void readVDP() {
	int * READ_STATUS = (int *) 0xC0000000;
	int entrance = 1;
	int instr;
	int data0;
	int data1;
	while (entrance | COMM_PORT(STATUS)==*READ_STATUS) {
		entrance = 0;
		while (COMM_PORT(STATUS) != READ_ME) ;
		COMM_PORT(STATUS) = *READ_STATUS;
	}
	instr = COMM_PORT(CTRL);
	data0 = COMM_PORT(DATA0);
	data1 = COMM_PORT(DATA1);
		// read others DATA
	COMM_PORT(STATUS) = WRITE_ME;
}
Here it is. I think it's pretty fast. I don't know it the 32X still is efficient like this, and I don't even know if the 32X has already benn used like this. But I find it a little funny, so ... expect more to come soon. Actually, I just hope the synchronization (waiting, looking, ....) doesn't waste too much time. Wait and see, as everything that is written here just runs ... in my brain !

Oh, by the way. I can tell now that I know what the 32X is. It took me nearly 18 monthes between knowing what the genesis was, and having got some skills for develop ...

Posted: Sun Feb 25, 2007 10:03 pm
by Fonzie
Appear good to me :)
It seems you want to use the 68K to drive the polygon sorting etc etc? Or i've misunderstood and you'll do all on 32x side?
I really can't wait to see a demo :D


Do you plan to add some 2d functions too (with some kind of caching to 32x's ram), lets say 128KB of Vram (2048 tiles of 256 colors)?

Then some functions like
-Load palette
-Load_tile
-Show_map
-Show sprite
...?

I think your method was used in some games... It is actualy good :D.


Good luck man :)

Posted: Sun Feb 25, 2007 10:39 pm
by ob1
The 32X hasn't anything to implement tile, so it'be kind of hell. Nevertheless, 2D can be implemented. Didn't figure exactly how yet.

Posted: Sun Feb 25, 2007 10:41 pm
by Fonzie
I mean, for software rendering :) ;) Working with tile isn't so bad but maybe they can be 64*64 pixels instead of 8*8 for faster drawing :)

Posted: Sun Feb 25, 2007 10:48 pm
by Stef
ob1 wrote:The 32X hasn't anything to implement tile, so it'be kind of hell. Nevertheless, 2D can be implemented. Didn't figure exactly how yet.
I know pitfall 32X handles a complex tile system in software on the 32X. A sort of classical 2D VDP as the genesis one with more colors :)

Using the com port for instruct command to SH2 sounds as a smart idea :) unfortunatly i don't remember how far i emulated the com port on SH-2 side, the SH-2 io stuff are very incomplete on Gens :-/
If something should work but doesn't work on Gens, try your program with Kega Fusion ;)

Posted: Mon Feb 26, 2007 7:49 am
by ob1
Fonzie wrote:I mean, for software rendering :) ;) Working with tile isn't so bad but maybe they can be 64*64 pixels instead of 8*8 for faster drawing :)
Don't tell me projects like that !!!! I could engage them !!!

Posted: Mon Feb 26, 2007 11:29 am
by ob1
Stef wrote:unfortunatly i don't remember how far i emulated the com port on SH-2 side, the SH-2 io stuff are very incomplete on Gens :-/
I'm talking about the software Comm Port, at A1 5120h from Genesis side and 2000 4020h from the 32X side.
Don't worry. I'm pretty damn sure your implementation of Comm Port is right. Else, Virtua Racing Deluxe wouldn't kick that ass.

Posted: Mon Feb 26, 2007 11:30 am
by Stef
ob1 wrote:
Stef wrote:unfortunatly i don't remember how far i emulated the com port on SH-2 side, the SH-2 io stuff are very incomplete on Gens :-/
I'm talking about the software Comm Port, at A1 5120h from Genesis side and 2000 4020h from the 32X side.
Don't worry. I'm pretty damn sure your implementation of Comm Port is right. Else, Virtua Racing Deluxe wouldn't kick that ass.
Ha ok. I though you were speaking about the internal SH-2 communication port :)

Posted: Mon Mar 12, 2007 2:45 pm
by ob1
Fonzie wrote:I really can't wait to see a demo
I've drawn something !!!!

Posted: Mon Mar 12, 2007 3:23 pm
by Fonzie
PM me the link for ^^ :D
do you get good speed results?

GLide 32x re-enaged

Posted: Wed May 09, 2007 4:18 pm
by ob1
SuperVDP aborted, here comes the GLide 32x again.
I've started to work on some basics command (grBufferSwap, grBufferClear, grDraw2DPlot). I am currently on grDraw2DLine. And the less I can tell is that it's gonna be way hard to kick the 32x ass !
The amount of work to be done for rendering seems huge to me ! Need to work a lot on paper, and really less on pipeline tricks ;)
Stay tuned.

Posted: Thu May 10, 2007 1:44 pm
by commodorejohn
There's one thing I have to say about this whole idea:

Quake 32X CD.