By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas...
Transcript of By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas...
![Page 1: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/1.jpg)
Indigo Shader Language and Winter
● By Nicholas Chapman, Managing Director, Glare Technologies Limited
● [email protected] http://www.indigorenderer.com/● Presented at European LLVM User Group Meeting, Sep 16th
2011, London, UK
![Page 2: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/2.jpg)
Talk contents
● Background – Indigo Renderer● Indigo Shader Language● The Winter programming language
![Page 3: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/3.jpg)
Indigo Renderer
● Photorealistic rendering software● An unbiased ray tracer● Main product of Glare Technologies Limited
![Page 4: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/4.jpg)
![Page 5: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/5.jpg)
![Page 6: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/6.jpg)
![Page 7: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/7.jpg)
Indigo Shader Language
● Embedded language used for customising material appearance
● User can write a small program to control e.g. the colour of a material
● Example:
def eval(vec3 pos) vec3 :vec3(sin(pos.z * 1000.0))
![Page 8: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/8.jpg)
![Page 9: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/9.jpg)
Indigo Shader Language
● Statically typed● Functional● Safe (no pointers etc..)● JIT compiled using LLVM● Efficient execution using vector types allowing SSE
codegen.● Performance similar to SSE-optimised C++.● Compiled shaders can be run concurrently in different
threads
![Page 10: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/10.jpg)
Demo!
● Demo of Indigo Renderer with realtime shader editing
![Page 11: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/11.jpg)
Introducing Winter
● Winter is a more general purpose programmable language in development
● Descendent of Indigo Shader Language● Primary design goals:
● High Level● Functional● Safe (well defined semantics, no pointers etc..)● High performance for engineering, scientific computing,
and computer graphics● Implicit Parallelism● Embeddable (in a host C++ program)● Backends:
– LLVM JIT for x86, x64– GPU: OpenCL or CUDA
![Page 12: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/12.jpg)
Simple Program
● Simple Program:
def main(float x, float y) float : x + y
![Page 13: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/13.jpg)
Let clauses
def f(float x) float : let
z = 2.0 y = 3.0
in y + z
def main() float : f(0.0)
![Page 14: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/14.jpg)
Structures and operator overloading
struct s { float x, float y }
def op_add(s a, s b) : s(a.x + b.x, a.y + b.y)
def main() float : x(s(1, 2) + s(3, 4))
![Page 15: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/15.jpg)
Higher order functions
def compose(function<float, float> f, function<float, float> g) : \(float x) : f(g(x))
def addOne(float x) : x + 1.0 def mulByTwo(float x) : x * 2.0 def main() float :
let z = compose(addOne, mulByTwo)
inz(1.0)
![Page 16: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/16.jpg)
Implicit Parallelism
def f(float x) float : pow(x, 1 / 2.2)
def main(array<T> a) : array<T>map(f, a)
The basic idea here is that map and fold (reduce) are elementary functions That divide the problem into chunks when possible, and distribute acrosscomputational units. (CPU cores, GPUs, network?)
WIP!
![Page 17: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/17.jpg)
The future of Winter
● Implement parallelising backend● Implement GPU backends● I hope to open source Winter at some point.
![Page 18: By Nicholas Chapman, Managing Director, Glare Technologies … · 2011. 10. 23. · By Nicholas Chapman, Managing Director, Glare Technologies Limited ... Main product of Glare Technologies](https://reader034.fdocuments.in/reader034/viewer/2022051409/601d0e40bf39fa33d03722dd/html5/thumbnails/18.jpg)
Thank you
● Thank you for your time!