Log In  
Follow
paniq

Cart #56728 | 2018-09-16 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

I was wondering if it would be possible to use structured temporal dithering to fake more than 16 colors, and it is indeed possible!

at 60hz, 1:2 mixes look fairly natural, but 1:4 mixes are a little too noisy.

3
2 comments



I've been designing some gradient palettes for various materials and wanted to share them here for inspiration.

got anymore ideas what to do? It seems especially blue leaves very little options...

9
1 comment



While experimenting with translating some "Zelda - Link From The Past" tiles into pico, I noticed that a lot of sprites save memory by mirroring the left half to the right one.

While the API allows drawing sprites mirrored along the x-axis, the map editor only permits one tile direction.

Would it be possible to add the ability to mirror sprites to the map editor as well?

1 comment



I've been thinking about how PICO-8 could provide very primitive 3D software rasterization capabilities that remain within the spirit of the system. These are just goofy ideas, please feel free to bury them if they're too far outside the project scope, but I had to at least write it down once.

In any case, it should be possible to implement nearly all of the features below in a cartridge.

Following things need to be implemented in order for this to work:

  • Mesh ROM
  • Mesh editor
  • API functions
  • Z-buffer

Mesh ROM specs:

  • 128 meshes (or less? animated meshes are considered here)
  • per mesh: 16 vertices, 16 quads (96 bytes)
  • index of 8x8 sprite to use as texture / colormap
  • Vertex format: 3x(0..7) position
  • Quad format: 4x(0..15) vertex index, 2x2x(0..7) uv rect (x1,y1,x2,y2)
    0 = no quad

The editor would get a new page with an editing view (64x64) that supports two modes: mesh editing and uv editing.

mesh editing:

  • The view supports free (orthogonal) rotation to preview the result and select obstructed vertices/faces.
  • An extra label displays the index of the selected vertex or face.
  • A toggle switches the view mode: textured / wireframe.
  • left-double-click creates a new vertex.
  • left-click selects a vertex or a face (depending on proximity of cursor to edge of face).
  • right-click on a vertex begins to build a face; 4 vertices of which at least 3 are unique need to be right-clicked in succession to complete the face; right-clicks that don't hit vertices are ignored. a left-click will abort. If the 4 vertices already comprise a face, the operation has no effect.
  • left-drag moves the vertex or face (all vertices of the face) along the orthogonal plane that's best facing the camera (dot product of view normal and plane normal closest to -1). That way no explicit orthogonal view is necessary. If a vertex is moved onto the position of another vertex, the vertex will be reset to its original position. That way, overlapping vertices are avoided.
  • right-drag orbits the camera around the center, and implicitly selects the plane along which vertices and faces will be moved when editing.
  • DELKEY removes the selected vertex or face. face removal does not remove vertices.
  • the mesh can be copied/pasted to other slots in order to facilitate the creation of animations.

uv editing (allowed when a face is selected):

  • The view shows the default 8x8 texture for this mesh, with a rectangle indicating the region that the active face will be mapped to. If only three vertices of the face are unique, the face will be a triangle (x1,y1 - x1,y2 - x2,y1).
  • Per default, the face is mapped to the entire texture.
  • x1,y1 are rounded to the upper left edge of the texel, x2,y2 are rounded to the lower right edge. That way, a single texel can color the entire quad.
  • An extra panel allows selecting the default texture this mesh will use.
  • left-drag draws a new rectangular bounding box for the quad. A simple left-click selects a single pixel as the quads texture.

The API gets 6 new functions:

clsz()

  • clears the z-buffer to 0 (see Z-buffer notes further below)

zget(x,y)
zset(x,y,z)

  • get or set the z-value of a z-buffer pixel.

camera3d(<x>, <y>, <z>, <m00>, <m01>, <m02>, <m10>, <m11>, <m12>, <m20>, <m21>, <m22>,

[ Continue Reading.. ]

2
7 comments



Cart #10716 | 2015-05-16 | Code ▽ | Embed ▽ | No License
7

An approach to dither the colors of the HSL colorspace with the 16 built-in colors. I settled for a randomized dither. You can download the source by clicking on the icon & saving the png.

7
0 comments



Cart #10704 | 2015-05-16 | Code ▽ | Embed ▽ | No License
10

A very simple 3D rasterizer that renders a rotating flat shaded cube.

10
1 comment



Cart #10782 | 2015-05-19 | Code ▽ | Embed ▽ | No License
50

This is kind of a parody of old amiga cracktros from a parallel universe, where duangle is a demoscene group, and so are all the people in the greetings!

1.1: added new greetings

50
9 comments



Cart #10683 | 2015-05-15 | Code ▽ | Embed ▽ | No License
4

This is my first cartridge, a tiny self-running intro with music that does a dithered sinus effect. This started as a fullscreen effect but I had to reduce the amount of pixels to fit the CPU limit.

ph34r!

4
0 comments



So I finally had some time to play with Pico-8 yesterday, and wrote two tiny cartridges, and instead of spamming zep on Twitter I thought it would be more useful to post my thoughts here, in order of appearance.

  1. Jelpi is a pretty impressive demo, i love everything about this handheld console that never existed :D

  2. There should be a version of the manual that looks like a 90's devkit manual black & white hardcopy, with a serious layout like the devkit cost $10k. But this is a bootlegged copy of the manual, so it got xerox smudges, is not fully level and is obviously copied right out of a bound book, and right on the first page it says stuff like "FOR YOUR EYES ONLY. YOU ARE CONTRACTUALLY BOUND TO NOT DISCLOSE ANY INFO" etc. On the second page there's a pompous introductory text from the company founder that flaunts the pico-8's luxurious capabilities, telling you how you can be proud to be able to develop for this console and how it's lightyears ahead of the competition. The manual is not even a full copy, it seems like it's just the most important pages copied out; the pages are numbered like 110-112, 351, 430, with paragraphs that make reference to appendixes that don't exist ("see Appendix E for chipset layout").

  3. It's obvious that this pico-8 firmware is the devkit, which starts with a prompt. I imagine a "consumer device" would boot right into the cartridges. :-)

  4. First I thought Lua's numeric type had been downgraded to signed short, but then I realized it's actually fixed point 16bit for both integer and fractional part. Very cool.

  5. I'd remove all references to Lua and give this language a different name, e.g. Picoscript or Picolua; otherwise I'd just expect everything to work the same way; it's sufficiently different, i think. Considering how all the commands are named, PicoBASIC seems most fitting.

  6. I thought that it would be more useful to arrange the palette in a way that makes the 4-bits more significant (e.g. LRGB), similar to how the default EGA color palette is arranged. In EGA, bit 3 effectively changes brightness (sort of) without altering hue, that allows for very easy lighting tricks. The numeric bits correspond to RGB, so you can fake additive light effects with simple bit twiddling. Here, i'd ultimately do it with a lookup table; I guess it's too late to change it anyway.

[ Continue Reading.. ]

16 comments