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.
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]




