pouët.net

fast 3d rendering/Kabuto's magic

category: general [glöplog]
 
How do I start learning to optimize software renderers? I want to make a wireframe game that runs fast, how do I learn this black magic? I saw Kabuto's work and I'm inspired, but I've read that that stuff wouldn't work in a game, does anyone know why?
added on the 2021-05-01 22:52:56 by Jaboody Jaboody
The first step is to start and try something. Have you taken that step yet?
added on the 2021-05-02 00:01:37 by yzi yzi
I'm going to start learning 6502 ASM as much as I can
added on the 2021-05-02 00:12:11 by Jaboody Jaboody
Mike Abrash’s black book is an entertaining read for sw rendering optimizations. Here is some talk about optimizing line drawing http://www.jagregory.com/abrash-black-book/#chapter-35-bresenham-is-fast-and-fast-is-good. You may need something more 6502 oriented though.
added on the 2021-05-02 03:53:44 by rloaderro rloaderro
here's more to read from our former member jix of titan (who we miss)

https://jix.one/pushing-polygons-on-the-mega-drive/
added on the 2021-05-02 12:57:23 by neoman neoman
Quote:
software renderers?

stop it, please
get help
added on the 2021-05-02 23:10:51 by Danilw Danilw
Quote:
Quote:
software renderers?

stop it, please
get help

Consider this a warning about your behaviour - this level of toxicity is pissing me off and I'm probably not the only one.
added on the 2021-05-03 00:00:40 by Gargaj Gargaj
Confirmed.
added on the 2021-05-03 00:08:53 by arm1n arm1n
Gargaj feel free to delete my account at any moment
added on the 2021-05-03 03:01:34 by Danilw Danilw
kabuto also wrote a bit about how he improved my approach (that neoman linked) in the middle of this document: https://docs.google.com/document/d/17pX_PS5uXSWoaS71JurC-DSKIV8ZAzlaP4o1jXbJ9CA

but yeah it requires lots of preprocessing, so it's not really usable for anything dynamic
added on the 2021-05-05 13:22:47 by jix jix
Quote:
I'm going to start learning 6502 ASM as much as I can

That said, i suggest a kindof backwards approach. Use your favourite high level language and knock up a bresenham line drawer. Then make a rotating cube using simple sinus tables and simple projection. Make this work simple and elegant and try to understand every detail of it. Once you are there, try converting it into 6502. Expect to fail hard, it will be slow and shit. Find out why. Optimize. Iterate a few times.

good luck :)
added on the 2021-05-06 20:41:29 by groepaz groepaz
Yeah I'd wager the optimization process is same regardless of platform:
- Write algorithm
- Optimize algorithmically (= finding mathematical ways that are faster)
- Optimize circumstantially (= choosing your use cases based on the dataset)
- Optimize to platform (= make code fit the architecture by using the right amount of CPU-memory tradeoffs, cache reads, etc.)
- And THEN you optimize the actual code itself and see if you can win cycles.
added on the 2021-05-06 21:22:55 by Gargaj Gargaj
I repeat: The first step is to start and try something.

If you haven't started and tried something, then reading advice on forums is completely meaningless.
added on the 2021-05-06 22:15:30 by yzi yzi
my own approach to this, when I was relearning amiga programming, was close to what groepaz said.

1. Make a dot plotter
2. Make a 2D rotator with the dot plotter
3. Extend to 3D rotation (and perspective) with the dot plotter
4. Extend to 3D line drawing vector
5. Extend to hidden line vector
6. Extend to Filled surface vector

So as others have mentioned, Start simple, with something you can grasp, and extend it further.
added on the 2021-05-09 12:53:50 by SCA SCA
btw: there is a good read here: An introduction to vector-based graphics on the Commodore 64

With examples in 6502 assembler.
added on the 2021-05-09 13:52:03 by SCA SCA

login