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

8


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


Trippy!


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


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?


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


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.


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.



[Please log in to post a comment]