# candycat1992/unity_shaders_book

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/candycat1992-unity-shaders-book).**

6,061 stars · 1,666 forks · ShaderLab

## Links

- GitHub: https://github.com/candycat1992/Unity_Shaders_Book
- awesome-repositories: https://awesome-repositories.com/repository/candycat1992-unity-shaders-book.md

## Description

This project is a reference library of HLSL shader implementations and source code examples for Unity. It provides a collection of practical samples focused on lighting, coordinate transformations, and rendering passes for 3D graphics.

The repository demonstrates the application of 3D rendering mathematics, specifically using vector and matrix calculations to determine light directions and coordinate space transformations. It includes implementations for managing multi-pass rendering pipelines and mapping coordinates between object, world, and view spaces.

The material covers foundational graphics rendering capabilities, including linear algebra for vector-to-matrix transformations, lighting and shading calculations for surface brightness, and the interaction between vertex and fragment shaders.

## Tags

### Game Development

- [Unity Shader Development](https://awesome-repositories.com/f/game-development/unity-shader-development.md) — Provides a comprehensive reference for authoring and implementing custom HLSL shaders within the Unity game engine.
- [Unity Visual Effects](https://awesome-repositories.com/f/game-development/unity-visual-effects.md) — Implements specific surface and lighting behaviors within the Unity engine to enhance the look of a game.

### Graphics & Multimedia

- [2D and 3D Graphics Rendering](https://awesome-repositories.com/f/graphics-multimedia/2d-and-3d-graphics-rendering.md) — Implements the fundamental mathematical operations required for rendering geometric shapes and lighting in 3D spaces.
- [Custom Shader Programming](https://awesome-repositories.com/f/graphics-multimedia/custom-shader-programming.md) — Provides custom HLSL shader code for vertex and fragment processing to control the rendering pipeline.
- [World-Space Lighting Calculations](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/lighting-systems/3d-lighting-models/advanced-lighting-effects/coordinate-based-lighting/world-space-lighting-calculations.md) — Computes light vectors and surface normals in global coordinates to determine diffuse and specular reflections.
- [Lighting Vector Calculations](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/lighting-systems/3d-lighting-models/light-source-functions/lighting-vector-calculations.md) — Computes vectors from vertices to light sources using world-space positions and normalization to determine surface illumination. ([source](http://candycat1992.github.io/unity_shaders_book/unity_shaders_book_faq.html))
- [Vertex and Fragment Shading](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/materials-shading/custom-shader-programs/vertex-and-fragment-shading.md) — Creates rendering pipelines that process vertex data and pixel colors for visual effects.
- [Vertex-Fragment Pipeline Splits](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/materials-shading/custom-shader-programs/vertex-fragment-pipeline-splits.md) — Separates per-vertex geometric calculations from per-pixel color interpolation for efficient rasterization.
- [Multi-Pass Rendering Pipelines](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/post-processing-pipelines/multi-pass-rendering-pipelines.md) — Implements architectures that chain multiple rendering operations to achieve complex surface and lighting effects.
- [Surface Shader Abstractions](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/rendering/graphics-apis-bindings/shader-transpilation-tools/function-to-shader-transpilers/surface-shader-abstractions.md) — Wraps low-level shader code into high-level interfaces to automate common lighting and shading calculations.

### Scientific & Mathematical Computing

- [Spatial Vector and Matrix Operations](https://awesome-repositories.com/f/scientific-mathematical-computing/high-performance-execution-environments/scientific-computing-platforms/scientific-computing/matrix-operations/matrix-vector-products/spatial-vector-and-matrix-operations.md) — Provides mathematical implementations for 3D spatial logic, including vector and matrix operations for GPU acceleration.

### User Interface & Experience

- [Coordinate Space Mappers](https://awesome-repositories.com/f/user-interface-experience/coordinate-systems/coordinate-converters/coordinate-space-mappers.md) — Implements utilities for mapping coordinates between object, world, and window spaces using transformation matrices.

### Web Development

- [Unity Asset Libraries](https://awesome-repositories.com/f/web-development/cross-platform-development/game-development-frameworks/unity-game-development-toolkits/unity-asset-libraries.md) — Serves as a collection of reusable HLSL shaders and templates for implementing lighting and transforms in Unity.

### Education & Learning Resources

- [Vector-to-Matrix Transformations](https://awesome-repositories.com/f/education-learning-resources/matrix-operations/matrix-to-graph-converters/vector-to-matrix-converters/vector-to-matrix-transformations.md) — Transforms vector dot products into matrix multiplications using column matrices and transpositions to simplify calculations. ([source](http://candycat1992.github.io/unity_shaders_book/unity_shaders_book_faq.html))
- [Unity Rendering Examples](https://awesome-repositories.com/f/education-learning-resources/unity-rendering-examples.md) — Provides practical code samples for managing multiple render passes and world-space transformations for 3D graphics.
