summaryrefslogtreecommitdiff
path: root/texture.c
Commit message (Collapse)AuthorAgeFilesLines
* define model(6) prim as P instead. add GREY8 textures. add more documentation.rodri2024-09-301-3/+8
|
* implement exportmodel(2).rodri2024-09-271-0/+1
| | | | this writes a model and its assets into a directory.
* implement a parser for a model(6). get rid of the libobj dependency.rodri2024-09-261-1/+0
|
* change the raster format to RGBA32. draw to any image format. clean up.rodri2024-09-111-0/+7
| | | | | | | | | | | | | | | | got rid of the bullshit dance between XRGB32 and RGBA32, now all rasters are RGBA32 and premultiply alpha before loading up an image and drawing over the destination. this lets the user compose their own scenes with correct transparency. no more mediocre clearcolor. as a consequence drawing got slower, but if i get the turbo drawing pool working properly that should go away. textures also take alpha pre-multiplied channels into account, dividing them when sampling, so loading transparent textures will show the correct colors.
* texture: clamp the coordinates instead of aborting when out of bounds.rodri2024-09-091-1/+2
|
* fix stack overflow, skybox fov sensibility and scene duplication.rodri2024-07-151-6/+19
| | | | | | | | | putting the duplicate camera in a local variable turned out to be a bad idea. bring the dynamic version back. the skybox rendering was affected by the camera fov, which made it look like it was not really at infinity, so set it always to 90°.
* fix the geometry glitches when moving things around.rodri2024-07-131-0/+19
| | | | | | | | | | it's possible for interactive programs to keep updating the geometry of the scene during rendering, which caused primitives to look deformed or shattered in the final image. to avoid this we take a snapshot of the current state of things (scene and camera), and render based on that copy.
* texture nomenclature changes. fb format RGBA → XRGB.rodri2024-07-091-2/+2
| | | | | | we are still doing alpha blending, so we use the X chan internally, but we don't care about it when (mem)drawing to the screen.
* create a new texture interface.rodri2024-07-051-28/+49
|
* rough color space conversion implementation.rodri2024-07-041-13/+5
| | | | | | | | colors are now properly processed in linear RGB space for lighting, shading and blending. sRGB is assumed for any texture sampled and the destination framebuffer. it's not perfect, but it does the job for now.
* add cubemaps.rodri2024-06-061-0/+102
|
* make the fshader return a Color instead of a Memimage. clean things up.rodri2024-03-061-5/+11
|
* add a texture sampler with nearest and bilinear routines.rodri2024-03-061-0/+104
pass the material reference along with the vertices. also implemented back-face culling, but it's disabled for now.