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.

P#74831 2020-04-16 14:26 ( Edited 2020-04-16 14:27)

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

P#74839 2020-04-16 16:56

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!"

P#74843 2020-04-16 17:07 ( Edited 2020-04-16 17:07)
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

P#74852 2020-04-16 19:12 ( Edited 2020-04-16 21:04)

@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.

P#74854 2020-04-16 20:42

@jobe Thanks!

P#74856 2020-04-16 21:38

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 20:51:44 | 0.043s | Q:19