I like to learn about BSP rendering

Started by
31 comments, last by the incredible smoker 6 years, 6 months ago

Thank you Eric for the link : http://fabiensanglard.net/doomIphone/doomClassicRenderer.php

very usefull information.

 

As they say : everything is done integer, this is exact the stuff i am looking for,

these chips you can program nowadays are comparable with oldschool computers / game consoles,

that is why you see more and more clones these days.

Ok, 32bit chips also has floating point, i prefer integer math, and learn more about using integer math for optimizing.

 

What i like to make : a software renderer that is all integer,

i,m happy with wolfenstein to begin with, once its done i can always go to doom renderer.

That would be very nice.

 

The good thing is i want to program 32 bit chips, i thought those 486 machines was all 16 bit right ?

So i have some advantage over older hardware with 32 bit being as fast as 8 or 16 bit instructions,

only clock speed might still be a problem for my current chips @ 50MHz.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

Advertisement

 

29 minutes ago, the incredible smoker said:

my current chips @ 50MHz.

ah, ok :)

I wrote a Doom like engine for Nokia NGage, that was 32 bit ARM CPU with 100 MHz.

I used integer math only (fixed point 16:16 mostly, sometimes 24:8), did also a bit of ASM (but not enough).

My engine was 2D BSP like doom but supported stacked rooms and voxel terrain similar to Outcast and perspective correct textured polygons for characters like Quake. No dynamic lighting, just lightmaps, character lit similar simply to Quake as well.

Screen resolution was 170 x 200. I got only 20 FPS. Commercial games did a bit better probably because they did the whole scanline in ASM.

486 was 32 bit and was too slow for Quake but fast enough for Doom IIRC.

23 minutes ago, the incredible smoker said:

everything is done integer, this is exact the stuff i am looking for,

That is not exactly accurate, IIRC it is done in fixed point... which uses the integer units in the CPU.

 

25 minutes ago, the incredible smoker said:

i,m happy with wolfenstein to begin with, once its done i can always go to doom renderer.

Wolfenstein used what was called back then "raycasting".  IIRC basically imagine a piece of graph paper.  Now imagine that each side of a square is potentially a wall, and the map just tells you if there is a wall there or not and if so what type(image) of wall it is.  The key to this technique is the walls are all regularly spaced.  This allows you to collide against the walls very easily using simple math.  Anyway there are books and tutorials online that will explain the details.

32 minutes ago, the incredible smoker said:

i thought those 486 machines was all 16 bit right ?

486's were 32bit.  I used to play wolfenstein and doom on a 486sx 25mhz. (sx means no floating point coprocessor)

 

33 minutes ago, the incredible smoker said:

So i have some advantage over older hardware with 32 bit being as fast as 8 or 16 bit instructions,

only clock speed might still be a problem for my current chips @ 50MHz.

What specific hardware are you targeting?  Rasberry pi?

-potential energy is easily made kinetic-

PIC32

 

Nice one Joe!

 

btw what is IIRC ?

 

i like to avoid ASM, i know its crucial for some things.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

4 minutes ago, the incredible smoker said:

btw what is IIRC ?

"If i remember correctly" - took me years to figure it out as well, but now it's quite useful :D

by the way : i have this display :

 

http://www.ebay.com/itm/3-2-inch-TFT-LCD-module-Display-with-touch-panel-SD-card-240x320-than-128x64-lcd-/311519653531?epid=697347844&hash=item488804ae9b:g:8DIAAOSwB-1Yp-4a

 

I,m searching for ray casting now, looks nice already if i could make that,

i want to build if from the ground up, not copying any wolfenstein code, maybe take a look.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

Here is a nice movie with the same display ILI9341

 

 

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

Looks fun.

The downside of raycasting: You need to draw vertical spans for everything, so no division free textured walls and ceilings. (I doupt your hardware has a division instruction.)

In my engine i used both vertical and horizontal spans within a polygon rasterizer. I can't remember how i achieved zero overdraw exactly, but i was quite proud of it because it seemed better to me than Quakes solution. It also served as HSR so no PVS was necessary (Probably i tested internal BSP node bounds against covered screen to clip whole braches of the level BSP behind a wall - for a 2.5D game like Doom this is a 1D problem, so very fast. I don't know if Doom uses PVS, Quake does.).

But the complexity is probably 50 times more than a raycaster, so raycasting will give you results much faster and may already max out the hardware.

I developing a voxel render in software with integer only operation, I have all math for matrix in fixed point. I don't make a software render with polygon but I have the pieces for do this.

But in :r4, a language close to ColorForth. 

 

 

Yes there is a division instruction, i thought it takes 18 instructions, very slow.

Is division needed ?, then i normally pre calculate lookuptables.

Only i,m not this far yet, i,m reading this site : http://lodev.org/cgtutor/raycasting.html

it says i need DDA "Digital Differential Analysis"

Now to find out what that is in C code.

 

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

This topic is closed to new replies.

Advertisement