# bamdaniyanaresh-png/origin-shader-rd-port architecture

> Architecture diagram of the GitHub repository bamdaniyanaresh-png/origin-shader-rd-port, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bamdaniyanaresh-png/origin-shader-rd-port
- Repository: https://github.com/bamdaniyanaresh-png/origin-shader-rd-port

## Overview

Newb X Origin is a Minecraft Bedrock RenderDragon shader port. The principal runtime workflow is Minecraft rendering inputs entering the shader materials, which apply world, atmosphere, and surface shading to produce the displayed scene. Its internal shader layer separates atmospheric scattering, cloud/sky rendering, lighting, terrain shading, and final color mapping. The README establishes the target renderer and product purpose; source excerpts and the index show several shader-module dependencies. Material-to-function wiring is not shown, so those connections are marked unverified. The build CLI is omitted as build infrastructure, not runtime product behavior.

Main entry points: [`src/materials/project.json`](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/materials/project.json) (Material Project), [`src/newb/functions/origin_cloud.h`](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_cloud.h) (Cloud And Sky), [`src/newb/functions/origin_atmosphere.h`](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_atmosphere.h) (Atmosphere Scattering), [`src/newb/functions/origin_light.h`](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_light.h) (World Lighting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_materials["RenderDragon Materials"]
  node_material_project["Material Project<br/>[project.json]"]
  node_terrain_material["Chunk Material<br/>[fragment.sc]"]
  node_actor_material["Actor Materials<br/>[fragment.sc]"]
  node_sky_material["Sky Materials<br/>[fragment.sc]"]
  node_cloud_material["Cloud Material<br/>[fragment.sc]"]
  node_hand_materials["Hand And Glint<br/>[fragment.sc]"]
end

subgraph group_environment["Sky And Atmosphere"]
  node_atmosphere["Atmosphere Scattering"]
  node_clouds["Cloud And Sky<br/>[origin_cloud.h]"]
end

subgraph group_shading["World Shading"]
  node_lighting["World Lighting<br/>[origin_light.h]"]
  node_terrain["Terrain Shading<br/>[origin_terrain.h]"]
  node_entity["Entity Shading<br/>[origin_entity.h]"]
end

subgraph group_support["Shader Support"]
  node_tonemap["Color Mapping<br/>[origin_tonemap.h]"]
  node_math["Shader Math<br/>[origin_math.h]"]
  node_config["Shader Configuration<br/>[origin_config.h]"]
  node_uniforms["Shared Uniforms"]
end

node_minecraft(("Minecraft Bedrock"))

node_minecraft -.->|"supplies render inputs"| node_material_project
node_material_project -.->|"selects materials"| node_terrain_material
node_material_project -.->|"selects materials"| node_actor_material
node_material_project -.->|"selects materials"| node_sky_material
node_material_project -.->|"selects materials"| node_cloud_material
node_material_project -.->|"selects materials"| node_hand_materials
node_atmosphere -->|"includes settings"| node_config
node_atmosphere -->|"uses math"| node_math
node_clouds -->|"includes scattering"| node_atmosphere
node_lighting -->|"includes sky functions"| node_clouds
node_terrain -->|"uses lighting"| node_lighting
node_entity -->|"uses lighting"| node_lighting
node_tonemap -->|"includes settings"| node_config
node_terrain_material -.->|"invokes shading"| node_terrain
node_actor_material -.->|"invokes shading"| node_entity
node_sky_material -.->|"invokes sky rendering"| node_clouds
node_cloud_material -.->|"invokes cloud rendering"| node_clouds
node_hand_materials -.->|"invokes shading"| node_entity
node_uniforms -.->|"provides shader inputs"| node_material_project

click node_material_project "https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/materials/project.json"
click node_terrain_material "https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/materials/RenderChunk/fragment.sc"
click node_actor_material "https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/materials/Actor/fragment.sc"
click node_sky_material "https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/materials/Sky/fragment.sc"
click node_cloud_material "https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/materials/Clouds/fragment.sc"
click node_hand_materials "https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/materials/ItemInHandTextured/fragment.sc"
click node_atmosphere "https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_atmosphere.h"
click node_clouds "https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_cloud.h"
click node_lighting "https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_light.h"
click node_terrain "https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_terrain.h"
click node_entity "https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_entity.h"
click node_tonemap "https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_tonemap.h"
click node_math "https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_math.h"
click node_config "https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_config.h"
click node_uniforms "https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/tree/main/src/common/uniforms"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_material_project,node_terrain_material,node_actor_material,node_sky_material,node_cloud_material,node_hand_materials toneBlue
class node_atmosphere,node_clouds toneAmber
class node_lighting,node_terrain,node_entity toneMint
class node_tonemap,node_math,node_config,node_uniforms toneRose
class node_minecraft toneIndigo
```

## Components

### RenderDragon Materials

- [Material Project](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/materials/project.json): `src/materials/project.json`
- [Chunk Material](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/materials/RenderChunk/fragment.sc): `src/materials/RenderChunk/fragment.sc`
- [Actor Materials](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/materials/Actor/fragment.sc): `src/materials/Actor/fragment.sc`
- [Sky Materials](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/materials/Sky/fragment.sc): `src/materials/Sky/fragment.sc`
- [Cloud Material](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/materials/Clouds/fragment.sc): `src/materials/Clouds/fragment.sc`
- [Hand And Glint](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/materials/ItemInHandTextured/fragment.sc): `src/materials/ItemInHandTextured/fragment.sc`

### Sky And Atmosphere

- [Atmosphere Scattering](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_atmosphere.h): `src/newb/functions/origin_atmosphere.h`
- [Cloud And Sky](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_cloud.h): `src/newb/functions/origin_cloud.h`

### World Shading

- [World Lighting](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_light.h): `src/newb/functions/origin_light.h`
- [Terrain Shading](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_terrain.h): `src/newb/functions/origin_terrain.h`
- [Entity Shading](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_entity.h): `src/newb/functions/origin_entity.h`

### Shader Support

- [Color Mapping](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_tonemap.h): `src/newb/functions/origin_tonemap.h`
- [Shader Math](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_math.h): `src/newb/functions/origin_math.h`
- [Shader Configuration](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/blob/main/src/newb/functions/origin_config.h): `src/newb/functions/origin_config.h`
- [Shared Uniforms](https://github.com/bamdaniyanaresh-png/origin-shader-rd-port/tree/main/src/common/uniforms): `src/common/uniforms`

### Other components

- **Minecraft Bedrock**

## Connections

- Minecraft Bedrock → Material Project: supplies render inputs (evidence: `README.md`)
- Material Project → Chunk Material: selects materials
- Material Project → Actor Materials: selects materials
- Material Project → Sky Materials: selects materials
- Material Project → Cloud Material: selects materials
- Material Project → Hand And Glint: selects materials
- Atmosphere Scattering → Shader Configuration: includes settings (evidence: `src/newb/functions/origin_atmosphere.h`)
- Atmosphere Scattering → Shader Math: uses math (evidence: `src/newb/functions/origin_atmosphere.h`)
- Cloud And Sky → Atmosphere Scattering: includes scattering (evidence: `src/newb/functions/origin_cloud.h`)
- World Lighting → Cloud And Sky: includes sky functions (evidence: `src/newb/functions/origin_light.h`)
- Terrain Shading → World Lighting: uses lighting (evidence: `src/newb/functions/origin_terrain.h`)
- Entity Shading → World Lighting: uses lighting (evidence: `src/newb/functions/origin_entity.h`)
- Color Mapping → Shader Configuration: includes settings (evidence: `src/newb/functions/origin_tonemap.h`)
- Chunk Material → Terrain Shading: invokes shading
- Actor Materials → Entity Shading: invokes shading
- Sky Materials → Cloud And Sky: invokes sky rendering
- Cloud Material → Cloud And Sky: invokes cloud rendering
- Hand And Glint → Entity Shading: invokes shading
- Shared Uniforms → Material Project: provides shader inputs
