Esta é a codebase do projeto de renderizador softengine (sem acelerador grafico; apenas CPU) do blog http://tomatofractal.io/category/rasterizer.html
Atualmente implementado:
- Biblioteca basica vetores/Matrizes
- Rasterizador de triangulos
- Bresenhan para linhas
- Backface culling
- Matriz de projeção
- Projecao > Viewport > Canvas pipeline
- Flat-shading
- Gourad shading
- Phong shading
- Mapeamento de texturas
- Bilinear filtering
- Mipmapping
- Stencil shadows
O objetivo deste repositorio é com fins didaticos, futuras melhorias vao incluir:
- Melhoramento da biblioteca de Algebra linear (usando closures)
- Adicionar à biblioteca de Algebra Linear Quaternions
- Implementaçao de um rasterizador com WebGL2
- Implementaçao de shadow map
- Algoritmos de flocking apenas para benchmark
- Refatoraçao da codebase com Typescript
- Refatoraçao da codebase para usar melhores padrões de projeto com melhores design patterns
- Parser de arquivos wavefront
.obj
A meta deste blog é a partir dos conceitos basicos de rasterização construir, do zero, um simples motor grafico para jogos 3D para browser. A intenção é ir do 0 à uma ferramenta capaz de criar jogos simples, sem animaçoes de bones.
![Captura de Tela 2024-03-08 às 23 52 57](https://private-user-images.githubusercontent.com/66750963/311409024-3810e0dd-fcee-4f34-bd5f-cdf6bf53f588.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU2NTQ2MDEsIm5iZiI6MTcxNTY1NDMwMSwicGF0aCI6Ii82Njc1MDk2My8zMTE0MDkwMjQtMzgxMGUwZGQtZmNlZS00ZjM0LWJkNWYtY2RmNmJmNTNmNTg4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQw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GDYX4Wc)
![Captura de Tela 2024-03-15 às 19 10 26](https://private-user-images.githubusercontent.com/66750963/313345949-e5460901-0b4a-46de-a5d8-ab58c053df0e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU2NTQ2MDEsIm5iZiI6MTcxNTY1NDMwMSwicGF0aCI6Ii82Njc1MDk2My8zMTMzNDU5NDktZTU0NjA5MDEtMGI0YS00NmRlLWE1ZDgtYWI1OGMwNTNkZjBlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTE0VDAyMzgyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJiYjQ5MTg3ODdlY2ZhNTI5NWEwMzIwMGQ0MDc4NGJiNzYzYzFmMmVmZmExOGRkNTcwZDViMzJkMjJmYWQwZmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.qClpZQYxwjIedxQvdVRbpwh0nfr1vwZ-1ynJq9b0qzY)
Apos clonar o projeto, basta rodar:
yarn
para instalar as dependencias
e para rodar:
yarn dev
This is the codebase for the rasterizer being developed at tomatofractal.io