aboutsummaryrefslogtreecommitdiff
path: root/src/renderer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* added mipmaps for the hw renderer, improvementsHEADmainvimene14 hours1-2/+2
| | | | | | | | | | | | | This commit add mipmaps, but for now, mipmaps are generated on the gpu at runtime. We should generate them in advance. - added mipmaps for the hardware renderer - renamed stb_image.c to stb_image.cpp - add compiler flag to stb_image.cpp to prevent warning - added pipe notation for various objects to have all clipping functions be left to right. We need this for the time being because dot notation would considerably complicate the current implementation - small improvements
* improved software shadersvimene2026-01-171-18/+39
| | | | | | | | - unified terminal and graphical software renderer shaders - added vertex shaders for software renderers - removed VertexData - moved shaders from frame buffers to their own class - added FrameBufferConcept and ShadersConcept
* rewrote entirely the triangle clipping algorithmvimene2026-01-151-40/+34
| | | | | | | | | | | | | | | | | | | There is still a lot of work needed to refactor it properly. - use the Sutherland–Hodgman algorithm, with some minor changes - made clipping more general, allowing clipping of any coordinate, before and after division by w - compute the z coordinate only at the fragment stage instead of each time clipping creates / moves a vertex, in addition to the fragment stage - added VectorCoords to choose at compile-time different coordinates based on a template argument - added transpose struct to allow shuffling of vectors coordinates - added math::utils::lerp which interpolate linearly a float - added Vector{2,3,4}::map() which maps a vector from one range to another - added template parameter to DerivedVertex (and therefore TriangleDerived) to allow choosing which dimension to use
* added textures for the hardware renderervimene2026-01-131-8/+5
| | | | | | | | | | | | | | | | | - removed "using" directive in .hpp - reverse order of arguments for quaternion rotation, i.e. q.rot(v) instead of v.rot(q), where q is a quaterinon and v a vector - pass the inverse of the view matrix to render_and_present_frame, to allow light calculation in shaders (we used to just pass the matrix of the quaternion of the transformation, i.e. discard scaling and translations) - added another mesh and texture (viking_room) for testing purposes - added transparent background option - added Quaternion::look_towards(), which is the equivalent of Matrix4::look_at() but only for rotations - various improvement to .obj parsing - load texture coordinates from .obj file - merged duplicate vertices in Mesh::linearize_indices()
* added uniform buffers, small tweaksvimene2025-12-241-1/+1
| | | | | | | | | | - fixed aspect ratio being the inverse of what it's supposed to be - use std::chrono::high_resolution_clock instead of system_clock - convert ellapsed time to float representing seconds - renamed engine::math::Matrix4::projection to perspective - use [0,1] instead of [-1,1] for the range of z values, to be aligned with vulkan - added engine::math::Matrix4::{look_at,transpose}
* renamed .h to .hppvimene2025-12-101-6/+6
|
* various improvementsvimene2025-01-021-32/+41
| | | | | | | | | | - cleaned up the computation of the camera's matrix - changed VertexData to being a struct which transmit data between the "vertex shader" and the "fragment shader" - started working on keyboard and mouse controls - added fov (field of view) - changed quaternion to euler angles conversion, from zyx to zxy - fixed computations of z coordinates in triangle rendering - improved naming in the triangle rasterizer
* various improvementsvimene2024-12-311-54/+68
| | | | | | | | | | | - added quaternions and rewrote all rotations to use them - added transforms to put all object transforms in a single place - added Wavefront .obj file parser - removed frame buffer's abstract class - improved vectors, matrices, triangles, vertices and vertices data by putting all code in header file - added vector's operations - changed from NULL to nullptr - miscellaneous improvements
* improved mesh definitionvimene2023-12-111-100/+78
| | | | | | | | - In the context of mesh definition, splited indices into vertex index, normal index and vertex data index to be able to specify different normals and vertex data for different faces using the same vertex
* fixed perspective, added planevimene2023-12-091-27/+19
|
* fixed perspective calculationsvimene2023-12-091-46/+70
|
* added renderer, improved various thingsvimene2023-12-051-0/+145
- Added renderer to unify frame buffers - Added FrameBuffer class as a parent for frame buffers' classes - Improved formatting in Makefile.am - Added const modifier in Matrix4's methods