Log In  


The code is still messy as heck so I'm going to at least tidy it up a bit before I share it :)

Next step, figuring out what to do about the perspective distortion. On a PS1 I'd just subdivide those triangles. On PICO-8, I'm already at 60% CPU, and while there's still room for optimization and I could always drop to 30 FPS, I don't think throwing more triangles at it is necessarily the right solution here.

Currently it calculates the UV coordinates correctly once per scanline. The first thing I'm going to try will probably be calculating them twice instead, splitting each rasterized line into half.

6


You know, I actually like the perspective distortion. Very PSX era style :)


Can you explain how tline works?
Grammarly is giving me "replace tline with line?" and I say "No!" and then it says "replace tline with lime?" and I say "No! Add it to my personal dictionary!"


1

you don’t need to split triangles (that will massively increase pressure on projection/clipping).
Old 3d engine splitted scaline in fixed chunks (like 8 pixels) - it does work pretty well.
see: https://twitter.com/FSouchu/status/1250688202605768704


@CandyColt_Games It draws a textured line - that is, instead of a single color or a fill pattern, it uses colours from the tile map. The syntax is:

tline(x0, y0, x1, y1, mx, my, [mdx, mdy])

where the first four values are the start and end of the line on the screen, mx and my are the tile coordinates for the pixel to be drawn at point 0, and mdx and mdy are delta values, which will be added to mx and my at each subsequent pixel.


@jobe Thanks!



[Please log in to post a comment]