Some of my projects. DISCLAIMER: These projects are not presented as a professional portfolio. These are fun things I work on in my free time; code quality is reflective of that.
An attempt at implementing a texture blending system for terrain. This approach blends between 3 textures using weights stored in a base texture. In other words for each pixel in base texture, the R value refers to how much of texture 1 to use, the G value refers to how much of texture 2 to use, and so on. This is allows me to smoothly blend between 3 different terrain textures. The obvious limitation is that it only supports 3 terrain textures. Also that base texture might end up getting quite large depending on the size of the terrain, unless you break the terrain into cells. I have no idea if this is how it is handled in serious engines but it works well enough for me. In the end the fragment shader code is as simple as:
vec4 computeTextureColour(vec2 TexCoords) {
vec4 weights = texture(baseMaterial.diffuse, TexCoords);
vec4 t1 = texture(terrainMaterial1.diffuse, TexCoords*terrainScalingFactor);
vec4 t2 = texture(terrainMaterial2.diffuse, TexCoords*terrainScalingFactor);
vec4 t3 = texture(terrainMaterial3.diffuse, TexCoords*terrainScalingFactor);
vec4 final = {
t1.r * weights.r + t2.r * weights.g + t3.r * weights.b,
t1.g * weights.r + t2.g * weights.g + t3.g * weights.b,
t1.b * weights.r + t2.b * weights.g + t3.b * weights.b,
1
};
return final;
}
The other benefit of doing it this way is I can use the texture paining too directly in blender to create the weights texture, which is quite a nice workflow. This could be extended by using additional maps to control things like e.g. snowfall, autumn leaves, etc. It would also be quite simple to generate the base texture procedurally (or modify it at runtime).
A further iteration on the 3D engine I worked on before, but this time integrating the Jolt physics engine. This is a WIP that I intend to continue working on. Jolt physics proved to be much nicer to integrate with (compared to bullet). Implementing the character controller especially was much easier.
A little 2d jrpg thing with a simple turn based combat system. Written in C++ with SDL2 using some assets ripped from dragon quest V. I used the Tiled editor to build the maps which are then loaded using https://github.com/nlohmann/json. Some basic ui stuff all just using SDL2. State machine handling transitioning into/outof combat and in-combat turns etc. All rendering is using a separate 2D engine DLL I created.
A simple 3D engine using openGL with Bullet physics integration. This project was initally going to be a general purpose 3d engine for making simple fps type games but got sidetracked trying to integrate the bullet physics engine so the project is a bit of a mess. Decent first attempt. Sets up the dynamics world and dumps a bunch of rigid bodies into it. Player control uses the built in btKinematicCharacterController class (this sucks btw). Is able to load a bunch of collision meshes using assimp so I can define the collision world in blender. Some basic point lights and other openGL stuff.
A little first person engine written in C++ with openGL. Some nice lighting and shadows, tile based levels, simple AABB collision detection, a first attempt at particle effects, some basic assets created in blender, imgui support (forgot to show in video). I'm quite fond of this project, should pick it up again at some point. Put off by the idea of modelling/animating 3D enemies (and implementing skinning/skeletal anims).