canvas icon indicating copy to clipboard operation
canvas copied to clipboard

Accept wrapping texture coordinates for non-atlas materials

Open grondag opened this issue 4 years ago • 1 comments
trafficstars

LativianModder has an entity render that exploits texture wrapping to simplify rendering of a multi-block model. Currently this cannot work with Canvas because UV coordinates are always conveyed as normalized unsigned shorts.

The enhancement would allow non-atlas materials to define a min/max value for UV coordinates and scale UV coordinates accordingly. The vertex format would still be unsigned shorts, but in shader this would be rescaled to whatever the defined range is. The default range would be 0-1 and 0-1 would still be required for atlas textures.

Enabling this feature for a material would also enable wrapping for the bound texture.

grondag avatar Jun 28 '21 19:06 grondag

An alternative / complement to this would be to expose a way to ignore render layers and let those render directly to the frame buffer as in vanilla. Obviously limitations with that approach but potentially a useful backstop when the API does not have what is needed.

grondag avatar Jun 29 '21 15:06 grondag