summaryrefslogtreecommitdiff
path: root/render.c
Commit message (Collapse)AuthorAgeFilesLines
* render: get rid of useless temporary.rodri2024-08-311-3/+2
|
* implement a general raster interface for the framebuffers.rodri2024-08-291-19/+44
| | | | | | | | | | | | | | | got a bit tired of having to add a ulong *buf every time i needed to get some data out of the shaders, so i made it possible to create as many extra buffers as needed, which then can be addressed from the fragment shader and drawn using the same drawing routines that were used for the color buffer. these so called Rasters are very similar to the OpenGL FBOs, in case you are familiar, but we address them by strings instead of numbers. and they can also be used as textures if you create one (see alloctexture) and then memdraw into it after every shot.
* fix the A-buffer so that it handles multiple render passes.rodri2024-08-211-12/+15
|
* fixes.rodri2024-08-131-2/+2
|
* fix FPINVAL error. knob for fb clear color. general improvements.rodri2024-08-111-3/+4
|
* experimental A-buffer implementation.rodri2024-08-101-15/+91
| | | | | | | | | very simple, without anti-aliasing, made for getting OIT (order independent transparency) rendering of arbitrary objects. also added switches for blending, depth testing and the A-buffer to the camera.
* fix a double-free. add a generic value-swapping macro.rodri2024-08-051-6/+6
|
* make the depth buffer 32-bit.rodri2024-08-041-1/+2
|
* fix line interpolation during rasterization.rodri2024-08-021-3/+3
| | | | | | | vertex attributes were not being updated after clipping with their corresponding work rectangles, nor when reordering the points before rasterization, which caused serious artifacts.
* implement pixel art upscaling filters scale[23]x. tidy up some code.rodri2024-07-161-4/+2
|
* enable culling and add a camera knob for it.rodri2024-07-131-4/+5
|
* fix the geometry glitches when moving things around.rodri2024-07-131-71/+75
| | | | | | | | | | 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.
* small improvements.rodri2024-07-121-6/+5
|
* texture nomenclature changes. fb format RGBA → XRGB.rodri2024-07-091-9/+9
| | | | | | 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.
* rough color space conversion implementation.rodri2024-07-041-2/+2
| | | | | | | | 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.
* render: don't overwrite the vertex colors with white. report alien prims.rodri2024-06-161-3/+2
|
* fix the barycoords routine to avoid reporting false degenerates.rodri2024-06-141-1/+27
| | | | added a normals buffer for debugging.
* replace the Memimage color buffer with a ulong* one. some fixes.rodri2024-06-131-30/+31
|
* add spotlight params and a light color shading routine. other things.rodri2024-06-101-4/+4
| | | | | | among these other things are clamping the color channels to [0,1] internally, and adding a modulation function for mixing colors/points.
* add cubemaps.rodri2024-06-061-0/+1
|
* add a tangent parameter for normal mapping, and a world2model xform.rodri2024-06-041-5/+1
|
* replace the Framebufctl's Lock with a QLock.rodri2024-05-231-0/+1
| | | | this provides fair scheduling, minimizing contention.
* fix line rasterization.rodri2024-05-211-6/+5
|
* fix the perspective projection and add inverse xform functions.rodri2024-05-201-112/+0
|
* render: improve line raster (not fixed yet). also tag jobs with an id.rodri2024-05-171-6/+7
|
* clip: fix rectclipline.rodri2024-05-031-1/+2
| | | | | mixed up CLIP[TB] and the slope was being computed as an integer division, which caused artifacts.
* add a general primitive with support for points, lines and triangles.rodri2024-05-031-264/+247
| | | | | | | | also got rid of the dependency on OBJ for the entire renderer, instead letting the user load a Model from any given OBJ. this modularity will allow for other formats to be used in the same way, relying on a single, internal representation for the entire pipeline.
* render: add rasterizer init params and per-proc identification.rodri2024-04-241-16/+20
|
* render: use the primitive's bbox to check for tile membership.rodri2024-04-181-9/+12
| | | | | | this fixes a bug i introduced with the fully concurrent pipeline, where instead of testing whether the triangle *crossed* any of the tiles, i checked whether any of the points *were inside*.
* render: make sure the last tile fills the screen.rodri2024-04-181-0/+2
|
* replace the Triangle with a general purpose Primitive.rodri2024-04-161-91/+94
| | | | | this is only an structural replacement and doesn't add support for the other primitive types.
* render: split tiles vertically instead of horizontally.rodri2024-04-151-4/+4
| | | | | this makes more sense memory-wise, and it also fixes a clipping glitch that was occurring at tile boundaries.
* add some instrumentation to measure pipeline stage time.rodri2024-04-151-2/+23
|
* implement a fully concurrent pipeline based on tiles.rodri2024-04-151-27/+171
| | | | | - got rid of the z-buffer lock to avoid contention. - little improvements to fb.c
* simplify the job scheduler. correct two mistakes regarding the Viewport.rodri2024-04-051-69/+26
| | | | | | | | | | > They made two mistakes. they hanged the wrong man and they didn't finish the job. so Clint Eastwood came back to kick my ass. the mistakes in question were that the Viewport shouldn't know about double buffering, conceptually it has a framebuffer and that's it. the second one was passing it to the renderer, when the renderer couldn't care less about what a viewport is.
* viewport: add a way to access front and back buffers.rodri2024-04-011-1/+1
|
* pass a Viewport in the Renderjob instead of a fb.rodri2024-03-261-2/+5
| | | | | do the frame buffer clearing and swapping as part of the rendering process, not within shootcamera.
* implement a (partially) concurrent pipeline.rodri2024-03-251-125/+186
|
* use the new libgeometry berp routines. add a frame counter to the camstats.rodri2024-03-211-2/+2
|
* pass material properties to the fshader.rodri2024-03-061-1/+1
| | | | | this way users can refer to per-surface material features when shading pixels.
* make the fshader return a Color instead of a Memimage. clean things up.rodri2024-03-061-20/+26
|
* add a texture sampler with nearest and bilinear routines.rodri2024-03-061-42/+58
| | | | | | pass the material reference along with the vertices. also implemented back-face culling, but it's disabled for now.
* add user-defined vertex attributes (varyings) and improve the interpolation ↵rodri2024-03-031-58/+47
| | | | code.
* have separate routines for drawing and memdrawing.rodri2024-02-271-1/+1
|
* interpolate every vertex attribute when clipping and during rasterization.rodri2024-02-251-21/+35
| | | | added parameters necessary to implement the Phong shading model.
* add initial support for OBJMaterial properties.rodri2024-02-211-9/+33
|
* pass an entire entity to the shader unit. fix a bug in cliptriangle.rodri2024-02-141-25/+21
| | | | | | | | | | an entity is passed instead of a model so we can access its frame of reference to perform the model-to-world transformation. the bug in cliptriangle was due to sd[01] being declared as static which, when rendering multiple entities, was causing d0 = d1, which led to division-by-zero.
* lay out the grounds for a scene renderer.rodri2024-02-131-126/+20
| | | | | | also fixed an issue with cliptriangle() where an entire tri would get discarded if all its vertices were outside the frustum.
* completed homogeneous clipping procedure.rodri2024-02-121-39/+60
|
* initial clipping implementation. (not fully working yet)rodri2024-02-101-67/+53
|