@Rayman said:
That would be awesome. Don't need right away though.
Another question is PSRAM bandwidth. Think seeing that exVGA is pulling video from PSRAM one line at a time.
Would one be correct in presuming that since this can work with PSRAM4, that with PSRAM16 there would be plenty of bandwidth for other cogs to be pulling/pushing lines at the same time?
At 320x240 16bpp it's not a bother, no. Pushing a full frame up is <1ms for 16 bit (Note that this is at 250Mhz and with plenty of overhead left on the PSRAM driver side), something like 1.6ms for 8bit. 4 bit gets a bit bad then (though probably still ok if not trying for the 60 FPS tour de force)
Just as a little update, I figured out full 3D clipping. This is important for rendering interior spaces, since often a visible triangle will have one or more of its vertices behind the camera. The code already employs a guard band, so triangles that would end just a few pixels off-screen can simply be scissored by the rasterizer instead of having to go through the complex/slow clipping process. This only works if all 3 vertices would have valid (±32767) 2D X/Y coordinates after projection. In cases where the vertex is e.g. behind the camera, clipping is inevitable, so I went ahead and implemented it.
This is kinda difficult to meaningfully demo if you don't already understand what it is, so let's just say the code goes to a different school for now (too lazy to clean it up).
@Rayman said:
Be nice if this could be with my raycaster to show sprite like things in more real 3d...
There's a (conceptually) simple thing you can do that's almost as good and really fits into that wall/sprite column rendering paradigm: Voxel models, as first introduced by BUILD engine.
Basically you've got a 3d array of voxels (in practice you want to compress it to not store empty/interior voxels). You calculate the distance and on-screen X position for each vertical column (like for a sprite) and then draw it. Things to keep in mind: draw the most distant columns first (there's 4 cases depending on relative angle, I think?), if it's close-up, each column may need to be drawn multiple pixels wide to avoid a gap.
Here's what that looks like (in a doom mod) - hard to really get it across in a still frame:
Comments
At 320x240 16bpp it's not a bother, no. Pushing a full frame up is <1ms for 16 bit (Note that this is at 250Mhz and with plenty of overhead left on the PSRAM driver side), something like 1.6ms for 8bit. 4 bit gets a bit bad then (though probably still ok if not trying for the 60 FPS tour de force)
Just as a little update, I figured out full 3D clipping. This is important for rendering interior spaces, since often a visible triangle will have one or more of its vertices behind the camera. The code already employs a guard band, so triangles that would end just a few pixels off-screen can simply be scissored by the rasterizer instead of having to go through the complex/slow clipping process. This only works if all 3 vertices would have valid (±32767) 2D X/Y coordinates after projection. In cases where the vertex is e.g. behind the camera, clipping is inevitable, so I went ahead and implemented it.
This is kinda difficult to meaningfully demo if you don't already understand what it is, so let's just say the code goes to a different school for now (too lazy to clean it up).
EDIT: OH NO I THINK THERE'S MORE BUGS
Be nice if this could be with my raycaster to show sprite like things in more real 3d...
There's a (conceptually) simple thing you can do that's almost as good and really fits into that wall/sprite column rendering paradigm: Voxel models, as first introduced by BUILD engine.
Basically you've got a 3d array of voxels (in practice you want to compress it to not store empty/interior voxels). You calculate the distance and on-screen X position for each vertical column (like for a sprite) and then draw it. Things to keep in mind: draw the most distant columns first (there's 4 cases depending on relative angle, I think?), if it's close-up, each column may need to be drawn multiple pixels wide to avoid a gap.
Here's what that looks like (in a doom mod) - hard to really get it across in a still frame:
