Log In  

Cart #midnightdrive-0 | 2022-09-18 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

This is an exercise in whether I could and not whether I should try and write a primitive 3D engine within 1024 compressed bytes. Turns out I could but visually it would've been better to fake it. Nevertheless, I thought I would upload it here anyway. As it's pretty rough I won't enter it officially into the jam. It would be interesting to see how people from the community who are more proficient go about the same challenge.

It lacks any depth ordering so I put some dithering in there which I wanted anyway and helps mask the problem. Similarly I thought it would be cool to have a street light effect on the "road" so dithering was used there. It also has some really ghetto hacks to prevent clipping.

Thanks @freds72 for the tri fill code from SupaHex.

Maybe this one's better overall:

Cart #midnightdrive2-0 | 2022-09-18 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

P#117618 2022-09-18 17:45 ( Edited 2022-09-18 19:09)

Nice job, very atmospheric. =)

I recently made a tiny trifill function (just 87 tokens), and I was curious so I plugged a version of it into the second demo. Down to 972 bytes, and lower CPU usage, too.

Cart #kutepikahu-0 | 2022-09-18 | Code ▽ | Embed ▽ | No License

P#117623 2022-09-18 19:55 ( Edited 2022-09-18 19:59)

I am only seeing two sides to these buildings, @WeeblBull, and @JadeLombax. Shouldn't there be 3 when you close up on them ?

P#117625 2022-09-18 20:35 ( Edited 2022-09-18 21:43)

@JadeLombax thanks for the code! I'm always amazed at how the community can keep crunching code down.

@dw817 there's only two faces (4 polys), mostly because back face culling isn't coded. I could've over-drawn the polys in a different order but with the swing of the camera, I didn't feel made it too obvious.

P#117631 2022-09-18 21:30 ( Edited 2022-09-18 21:36)

Hi @WeeblBull:

I guess as long as you don't close the camera in on the buildings you cannot tell, but yes, when you rotate the camera to see the buildings, you can see that there is no back to them.

Nonetheless it is an incredible effect. You really did quite master it.

P#117633 2022-09-18 21:43 ( Edited 2022-09-18 23:27)

Don't want to spam upload carts but here's the last edit I'll make. It includes the smaller tri fill from @JadeLombax, fixed drawing order (draw all the light sides first then all the dark ones), doubled the building count and slightly lowered the camera sway

URL Midnight Drive v3

P#117653 2022-09-19 15:30

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 13:55:23 | 0.037s | Q:31