Log In  

Cart #24724 | 2016-07-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
8

This is a shader thingy with a few variables and palettes to play around with.
It's all ready to go, but I might introduce dithering into the palettes in the future.

Left / Right changes the active value, and modify values when a value is chosen.
Button 1 activates and deactivates modifying values.
Button 2 changes the palette.

It has a few quirks:

  • The timer makes the image jerk a bit after 32000 seconds when it loops around.
  • Due to the way the pattern is drawn onto the spritesheet, a lot of the patterns will look weird and cut off. This drawing method made it run way faster though.
  • Floating point inaccuracies mess the printed values up a bit sometimes.

Have fun! :>

P#24725 2016-07-06 13:26 ( Edited 2016-07-12 14:14)

I like how you can line it up to have different angles and sizes. Good work!

P#24726 2016-07-06 13:37 ( Edited 2016-07-06 17:37)

Trippy!

P#24741 2016-07-06 17:57 ( Edited 2016-07-06 21:57)

Image aside, just wanted to say it's a nice job on the params menu. Instantly intuitive.

P#24775 2016-07-06 23:41 ( Edited 2016-07-07 03:41)

I am looking at the code of this. Really interesting technique, really shader-like. =)

One specific question: At the begin of the drawing-function you use rectfill(0,0,127,127,1) instead of cls().

Is there any specific reason for this (maybe performance-wise), or just a matter of taste / mood?

P#24796 2016-07-07 04:44 ( Edited 2016-07-07 08:44)

There's really no need to clear the entire screen, for that matter. Everything but the top 8 rows is getting written anyway.

P#24797 2016-07-07 05:32 ( Edited 2016-07-07 09:32)

You know, I just benchmarked them. CLS() is slower:

  • RECTFILL() clears 16 pixels per cycle, assuming a ~4.24MHz clock where "x=1" is one cycle.
  • CLS() clears 12 pixels per cycle.

That's... weird.

Edit: For anyone curious, MEMSET(0x6000,0,0x2000) is slightly faster than RECTFILL, probably because it doesn't do an outer loop for rows, but it's basically the same.

P#24806 2016-07-07 06:03 ( Edited 2016-07-07 10:31)

Heya, bit late here but thanks for the compliments! Nodepond, I used rectfill because I forgot cls existed ;v; and yeah, clearing the whole screen is just a habit I've gotten from OpenGL but not really necessary here.

P#25152 2016-07-12 10:14 ( Edited 2016-07-12 14:14)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 16:08:40 | 0.020s | Q:26