Skip to content

Instantly share code, notes, and snippets.

@rodrigobmg
rodrigobmg / rendering_engine.md
Created September 9, 2024 20:45 — forked from Erfan-Ahmadi/rendering_engine.md
Rendering Engine Development

1. What does the Rendering Engine Need?

  • Rendering Engine
    • Support for Multiple Graphics APIs : OpenGL | Vulkan | DirectX12 | DirectX11 | Metal
    • Content Export Pipeline : Create Maya/Max Plugins to export meshes based on Renderers needs. (Assimp Commercial Licence -> Pay)
    • Texture Compression Libraries
    • Material System : Artists Configure shaders, textures, parameters to import in game
    • Game-side Manager of Models/Materials/Lights
    • Good Visibility System (Frustum/Occlusion) (VisibilityBuffers?)
    • Multi-Threded Submission System to reduce cost of submission to GPU
  • Lighting/Shadow Rendering System
@rodrigobmg
rodrigobmg / app_metal.c
Created October 30, 2023 11:48 — forked from hasenj/app_metal.c
Pure C Cocoa Application with Window and Metal
// How to build:
// # compile the metal shaders
// xcrun -sdk macosx metal -c shaders.metal -o shaders.air
// xcrun -sdk macosx metallib shaders.air -o shaders.metallib
// # compile the c file
// clang app_metal.c -framework Cocoa -framework Metal -o metal_c.app
//
//
// Draw a triangle using metal
// Metal tutorial followed here: https://www.raywenderlich.com/7475-metal-tutorial-getting-started
#what we need:
#.include "macros.inc"
#.section .text # 0x80005940 - 0x803B7240
import sys, os, errno, re
import xlrd
# -============================================- #
@rodrigobmg
rodrigobmg / windows-7-plus-build-env-for-nitro.md
Created July 28, 2020 09:37 — forked from rlaphoenix/windows-7-plus-build-env-for-nitro.md
Windows 7+ Build Environment for Nintendo NITRO-System (Nintendo DS) compiling.
@rodrigobmg
rodrigobmg / deferreddevice.h
Created August 17, 2019 17:01 — forked from zeux/deferreddevice.h
Implementing Direct3D for fun and profit
struct DeferredDirect3DDevice9: DummyDirect3DDevice9
{
private:
char* begin;
char* write;
char* read;
char* end;
enum command_t
{
@rodrigobmg
rodrigobmg / DIContainerExample.cpp
Created July 1, 2019 08:21 — forked from niccroad/DIContainerExample.cpp
Write your own Dependency Injection container
/**
* More complete example code accompanying Write Your Own Dependency Injection Container.
* This is the most straight forward implementation of the DI container. While there is
* slightly more boilerplate there are also more customization and documentation points.
*
* Author Nicolas Croad 2019
*/
#define CATCH_CONFIG_MAIN
#include <catch.hpp>
@rodrigobmg
rodrigobmg / gist:53d876f7ec0fc79ff26413b94e464146
Created March 1, 2019 02:24 — forked from dmanning23/gist:417a2b9ea3c04c815dae
HLSL shader to light a 2d texture with normal map
// Effect applies normalmapped lighting to a 2D sprite.
float3 LightDirection;
float3 LightColor = 1.0;
float3 AmbientColor = 0.35;
sampler TextureSampler : register(s0);
sampler NormalSampler : register(s1)
{
Texture = (NormalTexture);
@rodrigobmg
rodrigobmg / reflect_inputlayout.cpp
Created February 16, 2019 01:13 — forked from mobius/reflect_inputlayout.cpp
Reflect DX11 Vertex shader to create input layout
HRESULT CreateInputLayoutDescFromVertexShaderSignature( ID3DBlob* pShaderBlob, ID3D11Device* pD3DDevice, ID3D11InputLayout** pInputLayout )
{
// Reflect shader info
ID3D11ShaderReflection* pVertexShaderReflection = NULL;
if ( FAILED( D3DReflect( pShaderBlob->GetBufferPointer(), pShaderBlob->GetBufferSize(), IID_ID3D11ShaderReflection, (void**) &pVertexShaderReflection ) ) )
{
return S_FALSE;
}
// Get shader info
@rodrigobmg
rodrigobmg / links.md
Created February 16, 2019 01:13 — forked from mobius/links.md
Writing a Modern Rendering Engine