Cruiser META (early work in progress)

General

nh_cham

6 years ago

Hey guys, 

I've got a long-term work-in-progress game which I'm working on occasionally. I started on the original Gamebuino (source code) and was happy to see that the Gamebuino META supports high resolution and colors. This is just a work in progress video full of glitches and artifacts, but it's running! Happy hacking!

jicehel

NEW 6 years ago

Good luck on your works. Good start. Quick. I hope you'll solve the glitches and graphical bugs to have perfect 3D motor for your game  ;)

Sorunome

NEW 6 years ago

looks interesting!

Is there any reason the camera isn't the full screen?

nh_cham

6 years ago

Good catch! The initial viewing frustum is a bit smaller so I can keep an eye on the wobbly edges, which is presumably the same kind of artifact that's visible between floor polygons. The outer frame should be constant, but it's not (yet). 

nh_cham

NEW 6 years ago

Sorunome Sorunome

Good catch! The initial viewing frustum is a bit smaller so I can keep an eye on the wobbly edges, which is presumably the same kind of artifact that's visible between floor polygons. The outer frame should be constant, but it's not (yet). 

Aurélien Rodot

NEW 6 years ago

I'm curious about how it works, because having a depth buffer like with regular ray-casting would use way too much RAM, wouldn't it ?

nh_cham

6 years ago

Correct, we'd need 80 kb of RAM for a decent Z buffer, so c'est pas possible! Also, we don't want to waste time drawing stuff that'll get overdrawn later. 

Cruiser uses a portal engine, which, if implemented correctly, results in a seamless, zero-overdraw rendering of an indoor scene (I'm sure I'll get there eventually).

It works as follows: the world consists of convex segments (polyhedra) which are interconnected by portals. So each surface of a segment is either a wall or a portal to another, adjacent segment. 

The camera is always in a certain segment, and we start by rendering this segment. We render all walls, and when we hit a portal, we render the adjacent segment through this hole next. Repeat until no more portals are encountered, and we're done. 

Rendering walls is done by iterating through them, and then clip each wall against the current viewing frustum, projecting it's vertices to the screen, and draw the polygon.

The only complication is that we need to be able to render geometry as seen through an arbitrary convex shape on the screen - also called the viewing frustum: the entire rectangular screen for the first segment, and the projected portal (hole) for the adjacent segment, and so on.

But that can be solved by generalizing clipping so that not only rectangular polygons can be used as clipping "frames", but also arbitrary, convex shapes. 

But clipping must be done in 3D, with all clipping planes going through the camera position: for the first frustum, it's like a pyramid that's pointing forward into the scene, for all following frustums, it's a smaller pyramid with possibly more than 4 sides. 

The glitches you see in the video are mostly due to precision problems with the clipping plane normals... so that's where more work is required. 

Hope that helps! 

nh_cham

NEW 6 years ago

Aurélien Rodot Aurélien Rodot

Correct, we'd need 80 kb of RAM for a decent Z buffer, so c'est pas possible! Also, we don't want to waste time drawing stuff that'll get overdrawn later. 

Cruiser uses a portal engine, which, if implemented correctly, results in a seamless, zero-overdraw rendering of an indoor scene (I'm sure I'll get there eventually).

It works as follows: the world consists of convex segments (polyhedra) which are interconnected by portals. So each surface of a segment is either a wall or a portal to another, adjacent segment. 

The camera is always in a certain segment, and we start by rendering this segment. We render all walls, and when we hit a portal, we render the adjacent segment through this hole next. Repeat until no more portals are encountered, and we're done. 

Rendering walls is done by iterating through them, and then clip each wall against the current viewing frustum, projecting it's vertices to the screen, and draw the polygon.

The only complication is that we need to be able to render geometry as seen through an arbitrary convex shape on the screen - also called the viewing frustum: the entire rectangular screen for the first segment, and the projected portal (hole) for the adjacent segment, and so on.

But that can be solved by generalizing clipping so that not only rectangular polygons can be used as clipping "frames", but also arbitrary, convex shapes. 

But clipping must be done in 3D, with all clipping planes going through the camera position: for the first frustum, it's like a pyramid that's pointing forward into the scene, for all following frustums, it's a smaller pyramid with possibly more than 4 sides. 

The glitches you see in the video are mostly due to precision problems with the clipping plane normals... so that's where more work is required. 

Hope that helps! 

Aurélien Rodot

6 years ago

Thanks a lot for that in depth answer... I feel that it could be turned into a tutorial once the game is finished ^^

Aurélien Rodot

NEW 6 years ago

nh_cham nh_cham

Thanks a lot for that in depth answer... I feel that it could be turned into a tutorial once the game is finished ^^