Log In  


Cart #bumpmap1k-1 | 2025-10-01 | Embed ▽ | License: CC4-BY-NC-SA
8

One last minute contribution to yet another edition of the #Pico1k jam hosted by the talented @Liquidream. My 1st attempt to a #Picotron production, using the significant power of userdata operations to implement bump mapping with directional and point lights, in 690 bytes of compressed code.

8


Strided userdata substraction is used to compute heightmap derivatives. The point light is implemented using offset products with a precomputed direction map, which then are combined with a precomputed distance map and the lighting values finally derived from a lookup table using userdata:take. This lookup table is setup so that it can simulate saturation when the indices are outside the intended range.



[Please log in to post a comment]