SlideShare a Scribd company logo
Woden 2: Developing a modern 3D
graphics engine
Ronie Salgado
Universidad de Chile
Talk Outline: Foundations
● Why rewriting Woden?
– OpenGL problems
– Classic graphics API (OpenGL, Direct 3D except 12)
– “Modern” PC architecture
– Modern graphics API (Vulkan, Direct 3D 12 and Metal)
● Core abstraction layers
– AbstractGPU
– Dastrel (Data Stream Language)
– Slovim (Dastrel back-end)
Talk Outline: Woden 2 Layers
● WodenMath library
● Core
– Pipeline state cache
– Resource cache
– GPU resource management
● Basic layers
– Scene graph
– Woden athens backend
● Application layers
– Woden Roassal ported to Woden 2
– Woden 2 Game System
– Level Editor
Why rewriting Woden 2?
● OpenGL is very complex.
● OpenGL drivers are very buggy!
– NVIDIA does not follow strictly the spec.
– AMD is very strict.
– Intel, OS specific behavior.
● OpenGL uses a thread local context.
● OpenGL is old.
● GLSL compiler is in the driver.
Choose a desktop OpenGL version
OpenGL GLSL
1.2 Not available
2.0 1.10
2.1 1.20
3.0 1.30
3.1 1.40
3.2 1.50
3.3 3.30
4.0 4.00
4.1 4.10
4.2 4.30
4.4 4.40
4.5 4.50
Classic graphics API
Canvas
Shader
CPU
● Set shader, depth buffer state, ...
● Set texture.
● Set vertex buffer.
● Set index buffer.
● Draw indexed elements.
GPU/CP
“Modern” PC Architecture
CPU
RAM
IOMMU VRAM
GPU
CP
Modern Low-Level Graphics API
CPU
CPCommand List
Pipeline State Object
Vertex BufferUniform Buffer Index Buffer
GPUMMap
Texture
Descriptor Set
DMA
Core Abstraction Layers
● AbstractGPU
– https://github.com/ronsaldo/abstract-gpu
● Dastrel (Data Stream Language)
– http://smalltalkhub.com/#!/~ronsaldo/Dastrel
● Slovim (LLVM inspired typed SSA form)
– http://smalltalkhub.com/#!/~ronsaldo/Slovim
AbstractGPU
● Abstraction above Vulkan, Metal and D3D 12.
● API in C inspired by OpenCL
● Implementation in C++
● XML spec for headers and bindings
● Mostly tested with Vulkan in Linux
Dastrel (Data Stream Language)
● Intended to be a semi-visual language
● Statically typed
● Syntax inspired by C, Rust, Swift and Smalltalk
● Dumb type inference
● Compiler front-end written in Pharo
● Emits Slovim SSA form
Dastrel Sample
import environment;
import fragment;
import material;
import lighting;
code_block(fragment) main
{
let N = normalize(FragmentInput.normal);
let V = normalize(-FragmentInput.position);
color: FragmentOutput.color <== forwardLightingModel
albedo: FragmentInput.color*MaterialState.albedo
fresnel: MaterialState.fresnel smoothness: MaterialState.smoothness
normal: N viewVector: V position: FragmentInput.position;
}
Dastrel Sample
struct ObjectStateData
{
matrix: float4x4;
inverseMatrix: float4x4;
color: float4;
visible: int;
}
uniform(set=0, binding=0) ObjectState
{
objectState: ObjectStateData;
}
buffer(set=0, binding=1) InstanceObjectState
{
instanceStates: ObjectStateData[];
}
uniform(set=1, binding=0) CameraState
{
inverseViewMatrix: float4x4;
viewMatrix: float4x4;
projectionMatrix: float4x4;
currentTime: float;
}
Dastrel
function transformPositionToWorld(position: float3) -> float4
{
using ObjectState;
using InstanceObjectState;
using VertexStage;
return objectState.matrix *
(instanceStates[instanceID].matrix * float4(position, 1.0f));
}
Slovim
● LLVM style SSA form in Pharo.
● Strongly typed.
● Some very basics optimizations.
● Backends for:
– Spir-V (Done)
– GLSL (Done for Vulkan, missing OpenGL)
– C++ (For testing/experimenting)
– HLSL (To be done)
– Metal Shading Language (To be done)
WodenMath
● 3D graphics linear algebra
– Vectors (2D, 3D, 4D)
– Complex
– Quaternions
– Matrices (3x3 and 4x4)
● Same memory layout as C/GPU structures.
● Optimized using Lowcode extended bytecodes.
WodenMath
● 3D graphics linear algebra
– Vectors (2D, 3D, 4D)
– Complex
– Quaternions
– Matrices (3x3 and 4x4)
● Same memory layout as C/GPU structures.
● Optimized using Lowcode extended bytecodes.
WodenMath
Woden 2 Core
● WTEngine is the main entry point
● WTPipelineStateCache loads PSO from JSON
● WTResourceCache for loading files
● WTApplication provides support for Morphic
and OSWindow
● They are wrappers above the AbstractGPU
object for supporting image session saving and
restoring
Woden 2 Core Utilities
● Custom bitmap font format
● Mesh building
● Some GPU structures matching shader
definitions
– WTObjectState
– WTCameraState
– WTLightSourceData
● 3D Model with skeletal animation loading
How do I get Woden 2
● https://github.com/ronsaldo/woden2
● newImage.sh builds dependencies and creates
a Woden 2 image
● Warning: this currently requires a modified VM
at https://github.com/ronsaldo/pharo-vm-
lowcode
Woden 2 Scene Graph
● Simpler than the scene graph in Woden 1.
● Only rendering a 3D scene (except for
WTSNodeModel)
WTFPSSampleApplicationCube
3D Scene Rendering
● Standard forward rendering.
● WTSForwardSceneRenderer
● Command lists are reused if the scene topology
does ot change
● Shadows and a deferred shading renderer are
not yet implemented
Woden 2 Athens Backend
Woden Roassal
Game System
Level Editor
● Bloc over Woden 2
Where is Woden 2?
● https://github.com/ronsaldo/woden2
● But, it requires a modified Pharo VM
● https://github.com/ronsaldo/pharo-vm-lowcode

More Related Content

PPTX
Top 10 poll interview questions with answers
PPT
mineria de datos aplicada a inventarios
PDF
Replicated Service Objects -- A Strategy for Distributed Applications
PDF
GemStone/64 product update and road map
PDF
Perfection & Feedback Loops or: why worse is better
PDF
Lub: a DSL for Dynamic Context Oriented Programming
PPSX
Introduction to Direct 3D 12 by Ivan Nevraev
KEY
Interactive Graphic Storytelling: “How the Internet Impacts the Graphic Novel”
Top 10 poll interview questions with answers
mineria de datos aplicada a inventarios
Replicated Service Objects -- A Strategy for Distributed Applications
GemStone/64 product update and road map
Perfection & Feedback Loops or: why worse is better
Lub: a DSL for Dynamic Context Oriented Programming
Introduction to Direct 3D 12 by Ivan Nevraev
Interactive Graphic Storytelling: “How the Internet Impacts the Graphic Novel”

Viewers also liked (20)

PPT
Human Action Recognition Based on Spacio-temporal features
PPTX
Pelican Mapping - FOSS4G 2011
PDF
UP200 dental 3d scanner with dental CAD
PPTX
Special Photo Effects
PPT
Radiosity algorithm
PDF
GLSL Shading with OpenSceneGraph
PPT
Shtanchaev_SPEKTR
PPTX
Steel monkeys: Unity3D глазами программиста графики
PPTX
Shells
PDF
Typography on the Web
PPTX
Quadtree In Game
PPTX
What is 3 d modeling unit 66
PPTX
Orthographic projection
ODP
Building a DIY 3D Scanner
PPTX
Chapter 11 biotechnology by mohanbio
PPTX
Migrating from OpenGL to Vulkan
PPTX
3D scanner using kinect
PPTX
3D internet
PDF
3D Laser Scanning
ODP
The Image-based data glove presentation
Human Action Recognition Based on Spacio-temporal features
Pelican Mapping - FOSS4G 2011
UP200 dental 3d scanner with dental CAD
Special Photo Effects
Radiosity algorithm
GLSL Shading with OpenSceneGraph
Shtanchaev_SPEKTR
Steel monkeys: Unity3D глазами программиста графики
Shells
Typography on the Web
Quadtree In Game
What is 3 d modeling unit 66
Orthographic projection
Building a DIY 3D Scanner
Chapter 11 biotechnology by mohanbio
Migrating from OpenGL to Vulkan
3D scanner using kinect
3D internet
3D Laser Scanning
The Image-based data glove presentation
Ad

Similar to Woden 2: Developing a modern 3D graphics engine in Smalltalk (20)

PPT
Advanced Graphics Workshop - GFX2011
PDF
Minko - Flash Conference #5
PPT
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
PPT
SIGGRAPH 2012: NVIDIA OpenGL for 2012
PDF
Open gl
PDF
Virtual Reality in Pharo: Challenges and Demo
PPTX
OpenGL ES EGL Spec&APIs
PPT
NVIDIA OpenGL in 2016
PDF
PG-4034, Using OpenGL and DirectX for Heterogeneous Compute, by Karl Hillesland
PDF
Inspecting Block Closures To Generate Shaders for GPU Execution
PDF
Minko - Targeting Flash/Stage3D with C++ and GLSL
PPTX
Decima Engine: Visibility in Horizon Zero Dawn
PDF
Computer Graphics - Lecture 01 - 3D Programming I
PPT
OpenGL 4 for 2010
PDF
Power of WebGL (FSTO 2014)
PPTX
Graphics Libraries
PPTX
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio
PDF
lectureAll-OpenGL-complete-Guide-Tutorial.pdf
PPT
CS 354 Programmable Shading
PDF
Low Level Graphics & OpenGL
Advanced Graphics Workshop - GFX2011
Minko - Flash Conference #5
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH 2012: NVIDIA OpenGL for 2012
Open gl
Virtual Reality in Pharo: Challenges and Demo
OpenGL ES EGL Spec&APIs
NVIDIA OpenGL in 2016
PG-4034, Using OpenGL and DirectX for Heterogeneous Compute, by Karl Hillesland
Inspecting Block Closures To Generate Shaders for GPU Execution
Minko - Targeting Flash/Stage3D with C++ and GLSL
Decima Engine: Visibility in Horizon Zero Dawn
Computer Graphics - Lecture 01 - 3D Programming I
OpenGL 4 for 2010
Power of WebGL (FSTO 2014)
Graphics Libraries
[Unite Seoul 2019] Mali GPU Architecture and Mobile Studio
lectureAll-OpenGL-complete-Guide-Tutorial.pdf
CS 354 Programmable Shading
Low Level Graphics & OpenGL
Ad

More from ESUG (20)

PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
PDF
Micromaid: A simple Mermaid-like chart generator for Pharo
PDF
Directing Generative AI for Pharo Documentation
PDF
Even Lighter Than Lightweiht: Augmenting Type Inference with Primitive Heuris...
PDF
Composing and Performing Electronic Music on-the-Fly with Pharo and Coypu
PDF
Gamifying Agent-Based Models in Cormas: Towards the Playable Architecture for...
PDF
Analysing Python Machine Learning Notebooks with Moose
PDF
FASTTypeScript metamodel generation using FAST traits and TreeSitter project
PDF
Migrating Katalon Studio Tests to Playwright with Model Driven Engineering
PDF
Package-Aware Approach for Repository-Level Code Completion in Pharo
PDF
Evaluating Benchmark Quality: a Mutation-Testing- Based Methodology
PDF
An Analysis of Inline Method Refactoring
PDF
Identification of unnecessary object allocations using static escape analysis
PDF
Control flow-sensitive optimizations In the Druid Meta-Compiler
PDF
Clean Blocks (IWST 2025, Gdansk, Poland)
PDF
Encoding for Objects Matters (IWST 2025)
PDF
Challenges of Transpiling Smalltalk to JavaScript
PDF
Immersive experiences: what Pharo users do!
PDF
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
PDF
Cavrois - an Organic Window Management (ESUG 2025)
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
Micromaid: A simple Mermaid-like chart generator for Pharo
Directing Generative AI for Pharo Documentation
Even Lighter Than Lightweiht: Augmenting Type Inference with Primitive Heuris...
Composing and Performing Electronic Music on-the-Fly with Pharo and Coypu
Gamifying Agent-Based Models in Cormas: Towards the Playable Architecture for...
Analysing Python Machine Learning Notebooks with Moose
FASTTypeScript metamodel generation using FAST traits and TreeSitter project
Migrating Katalon Studio Tests to Playwright with Model Driven Engineering
Package-Aware Approach for Repository-Level Code Completion in Pharo
Evaluating Benchmark Quality: a Mutation-Testing- Based Methodology
An Analysis of Inline Method Refactoring
Identification of unnecessary object allocations using static escape analysis
Control flow-sensitive optimizations In the Druid Meta-Compiler
Clean Blocks (IWST 2025, Gdansk, Poland)
Encoding for Objects Matters (IWST 2025)
Challenges of Transpiling Smalltalk to JavaScript
Immersive experiences: what Pharo users do!
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
Cavrois - an Organic Window Management (ESUG 2025)

Recently uploaded (20)

PDF
Machine learning based COVID-19 study performance prediction
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
KodekX | Application Modernization Development
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Encapsulation theory and applications.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
A Presentation on Artificial Intelligence
PDF
Spectral efficient network and resource selection model in 5G networks
Machine learning based COVID-19 study performance prediction
Advanced methodologies resolving dimensionality complications for autism neur...
Reach Out and Touch Someone: Haptics and Empathic Computing
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
KodekX | Application Modernization Development
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Understanding_Digital_Forensics_Presentation.pptx
Electronic commerce courselecture one. Pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Weekly Chronicles - August'25 Week I
Encapsulation theory and applications.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
NewMind AI Monthly Chronicles - July 2025
A Presentation on Artificial Intelligence
Spectral efficient network and resource selection model in 5G networks

Woden 2: Developing a modern 3D graphics engine in Smalltalk

  • 1. Woden 2: Developing a modern 3D graphics engine Ronie Salgado Universidad de Chile
  • 2. Talk Outline: Foundations ● Why rewriting Woden? – OpenGL problems – Classic graphics API (OpenGL, Direct 3D except 12) – “Modern” PC architecture – Modern graphics API (Vulkan, Direct 3D 12 and Metal) ● Core abstraction layers – AbstractGPU – Dastrel (Data Stream Language) – Slovim (Dastrel back-end)
  • 3. Talk Outline: Woden 2 Layers ● WodenMath library ● Core – Pipeline state cache – Resource cache – GPU resource management ● Basic layers – Scene graph – Woden athens backend ● Application layers – Woden Roassal ported to Woden 2 – Woden 2 Game System – Level Editor
  • 4. Why rewriting Woden 2? ● OpenGL is very complex. ● OpenGL drivers are very buggy! – NVIDIA does not follow strictly the spec. – AMD is very strict. – Intel, OS specific behavior. ● OpenGL uses a thread local context. ● OpenGL is old. ● GLSL compiler is in the driver.
  • 5. Choose a desktop OpenGL version OpenGL GLSL 1.2 Not available 2.0 1.10 2.1 1.20 3.0 1.30 3.1 1.40 3.2 1.50 3.3 3.30 4.0 4.00 4.1 4.10 4.2 4.30 4.4 4.40 4.5 4.50
  • 6. Classic graphics API Canvas Shader CPU ● Set shader, depth buffer state, ... ● Set texture. ● Set vertex buffer. ● Set index buffer. ● Draw indexed elements. GPU/CP
  • 8. Modern Low-Level Graphics API CPU CPCommand List Pipeline State Object Vertex BufferUniform Buffer Index Buffer GPUMMap Texture Descriptor Set DMA
  • 9. Core Abstraction Layers ● AbstractGPU – https://github.com/ronsaldo/abstract-gpu ● Dastrel (Data Stream Language) – http://smalltalkhub.com/#!/~ronsaldo/Dastrel ● Slovim (LLVM inspired typed SSA form) – http://smalltalkhub.com/#!/~ronsaldo/Slovim
  • 10. AbstractGPU ● Abstraction above Vulkan, Metal and D3D 12. ● API in C inspired by OpenCL ● Implementation in C++ ● XML spec for headers and bindings ● Mostly tested with Vulkan in Linux
  • 11. Dastrel (Data Stream Language) ● Intended to be a semi-visual language ● Statically typed ● Syntax inspired by C, Rust, Swift and Smalltalk ● Dumb type inference ● Compiler front-end written in Pharo ● Emits Slovim SSA form
  • 12. Dastrel Sample import environment; import fragment; import material; import lighting; code_block(fragment) main { let N = normalize(FragmentInput.normal); let V = normalize(-FragmentInput.position); color: FragmentOutput.color <== forwardLightingModel albedo: FragmentInput.color*MaterialState.albedo fresnel: MaterialState.fresnel smoothness: MaterialState.smoothness normal: N viewVector: V position: FragmentInput.position; }
  • 13. Dastrel Sample struct ObjectStateData { matrix: float4x4; inverseMatrix: float4x4; color: float4; visible: int; } uniform(set=0, binding=0) ObjectState { objectState: ObjectStateData; } buffer(set=0, binding=1) InstanceObjectState { instanceStates: ObjectStateData[]; } uniform(set=1, binding=0) CameraState { inverseViewMatrix: float4x4; viewMatrix: float4x4; projectionMatrix: float4x4; currentTime: float; }
  • 14. Dastrel function transformPositionToWorld(position: float3) -> float4 { using ObjectState; using InstanceObjectState; using VertexStage; return objectState.matrix * (instanceStates[instanceID].matrix * float4(position, 1.0f)); }
  • 15. Slovim ● LLVM style SSA form in Pharo. ● Strongly typed. ● Some very basics optimizations. ● Backends for: – Spir-V (Done) – GLSL (Done for Vulkan, missing OpenGL) – C++ (For testing/experimenting) – HLSL (To be done) – Metal Shading Language (To be done)
  • 16. WodenMath ● 3D graphics linear algebra – Vectors (2D, 3D, 4D) – Complex – Quaternions – Matrices (3x3 and 4x4) ● Same memory layout as C/GPU structures. ● Optimized using Lowcode extended bytecodes.
  • 17. WodenMath ● 3D graphics linear algebra – Vectors (2D, 3D, 4D) – Complex – Quaternions – Matrices (3x3 and 4x4) ● Same memory layout as C/GPU structures. ● Optimized using Lowcode extended bytecodes.
  • 19. Woden 2 Core ● WTEngine is the main entry point ● WTPipelineStateCache loads PSO from JSON ● WTResourceCache for loading files ● WTApplication provides support for Morphic and OSWindow ● They are wrappers above the AbstractGPU object for supporting image session saving and restoring
  • 20. Woden 2 Core Utilities ● Custom bitmap font format ● Mesh building ● Some GPU structures matching shader definitions – WTObjectState – WTCameraState – WTLightSourceData ● 3D Model with skeletal animation loading
  • 21. How do I get Woden 2 ● https://github.com/ronsaldo/woden2 ● newImage.sh builds dependencies and creates a Woden 2 image ● Warning: this currently requires a modified VM at https://github.com/ronsaldo/pharo-vm- lowcode
  • 22. Woden 2 Scene Graph ● Simpler than the scene graph in Woden 1. ● Only rendering a 3D scene (except for WTSNodeModel)
  • 24. 3D Scene Rendering ● Standard forward rendering. ● WTSForwardSceneRenderer ● Command lists are reused if the scene topology does ot change ● Shadows and a deferred shading renderer are not yet implemented
  • 25. Woden 2 Athens Backend
  • 28. Level Editor ● Bloc over Woden 2
  • 29. Where is Woden 2? ● https://github.com/ronsaldo/woden2 ● But, it requires a modified Pharo VM ● https://github.com/ronsaldo/pharo-vm-lowcode