1. Blender PT
Conference 2013
Porto (Portugal)
Carlos Glez. Morcillo
Associate Professor
Escuela Superior de Informática
University of Castilla-La Mancha
Blender Foundation
Certified Trainer
April 7th
2013
or... “Using Blender as an Integrated
Rendering Engine in R&D projects”
2. [Slide 2]
□ What is Rendering?
□ Why Blender?
□ Blender as a
«Black Box»
□ R&D Projects
□ MultiAgent Rendering
□ Sign Language
□ Indoor Navigation
□ Showcase
Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Contents
Intro Why Blender? Black Box R&D Projects Showcase
3. [Slide 3]
□ What is Rendering?
□ Why Blender?
□ Blender as a
«Black Box»
□ R&D Projects
□ MultiAgent Rendering
□ Sign Language
□ Indoor Navigation
□ Showcase
Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Contents
Intro Why Blender? Black Box R&D Projects Showcase
4. [Slide 4]
□ What is Rendering?
□ Why Blender?
□ Blender as a
«Black Box»
□ R&D Projects
□ MultiAgent Rendering
□ Sign Language
□ Indoor Navigation
□ Showcase
Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Contents
Intro Why Blender? Black Box R&D Projects Showcase
5. [Slide 5]
□ What is Rendering?
□ Why Blender?
□ Blender as a
«Black Box»
□ R&D Projects
□ MultiAgent Rendering
□ Sign Language
□ Indoor Navigation
□ Showcase
Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Contents
Intro Why Blender? Black Box R&D Projects Showcase
6. [Slide 6]
□ What is Rendering?
□ Why Blender?
□ Blender as a
«Black Box»
□ R&D Projects
□ MultiAgent Rendering
□ Sign Language
□ Indoor Navigation
□ Showcase
Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Contents
Intro Why Blender? Black Box R&D Projects Showcase
7. [Slide 7]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Intro Why Blender? Black Box R&D Projects Showcase
Botticelli (XV)Botticelli (XV)
SearchforRealism...SearchforRealism...
8. [Slide 8]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
SearchforRealism...SearchforRealism...
Intro Why Blender? Black Box R&D Projects Showcase
Botticelli (XV)Botticelli (XV)
9. [Slide 9]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
SearchforRealism...SearchforRealism...
Intro Why Blender? Black Box R&D Projects Showcase
Botticelli (XV)Botticelli (XV)
10. [Slide 10]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
SearchforRealism...SearchforRealism...
Intro Why Blender? Black Box R&D Projects Showcase
Albrecht Dürer (XVI)Albrecht Dürer (XVI)
11. Input Bin
[Slide 11]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
WhatisRendering?
What? Compute color for each pixel.
How? Different Methods.
Intro Why Blender? Black Box R&D Projects Showcase
Real Time Rendering
(GPU Based)
“Realistic” Ray-Traced Rendering
(Normally CPU Based)
16. [Slide 16]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
WhyBlender?
Intro Why Blender? Black Box R&D Projects Showcase
Blender is
Free Software
F0: Run the program
F1: Study how it works,
and change it
F2: Redistribute copies.
F3: Distribute copies of
your modified versions.
Integration in
R&D Projects!
4 Essential Freedoms:
17. [Slide 17]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
WhyBlender?
Intro Why Blender? Black Box R&D Projects Showcase
Blender is
Free Software
F0: Run the program
F1: Study how it works,
and change it
F2: Redistribute copies.
F3: Distribute copies of
your modified versions.
Integration in
R&D Projects!
4 Essential Freedoms:
18. [Slide 18]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
WhyBlender?
Intro Why Blender? Black Box R&D Projects Showcase
Blender is
Free Software
F0: Run the program
F1: Study how it works,
and change it
F2: Redistribute copies.
F3: Distribute copies of
your modified versions.
Integration in
R&D Projects!
4 Essential Freedoms:
21. Input Bin
Input Bin
Intro Why Blender? Black Box R&D Projects Showcase
[Slide 21]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Blenderasa«BlackBox»
22. Input Bin
Intro Why Blender? Black Box R&D Projects Showcase
After
some
Time
Working
Input Bin
[Slide 22]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Blenderasa«BlackBox»
23. Input Bin
Intro Why Blender? Black Box R&D Projects Showcase
Resulting
2D Image
After
some
Time
Input Bin
[Slide 23]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Blenderasa«BlackBox»
24. [Slide 24]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
BlenderinNumbers
Intro Why Blender? Black Box R&D Projects Showcase
● 84% C/C++, 13% Python, 3% Others
● 345 Years of effort!! (> 15.000.000 €)
● Large development team (>90)
25. [Slide 25]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
QualityoftheBlenderCode
Intro Why Blender? Black Box R&D Projects Showcase
"The only reliable measurement of Code Quality: WTFs/minute!"
26. [Slide 26]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
SomeBlenderSnippets
Intro Why Blender? Black Box R&D Projects Showcase
Blender 2.26 (first public release)
intern/decimation/test/decimate_glut_test/intern/main.cpp
Lines 192-198
faces>push_back(load_face.verts[0]);
faces>push_back(load_face.verts[1]);
faces>push_back(load_face.verts[2]);
// free up the memory this pile of shit used
// to allocate the polygon's vertices
free (load_face.verts);
27. [Slide 27]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
SomeBlenderSnippets
Intro Why Blender? Black Box R&D Projects Showcase
Blender 2.26 (first public release)
source/blender/render/intern/source/rendercore.c
Lines 230-240
void scanlinesky(char *rect, int y)
{
/* have to type this! set to : addalphaUnder:
char*, char* addalphaUnderGamma: ditto called
with char *, uint* !!! unmangle this shit... */
void (*alphafunc)();
float fac;
int dx, x, ofs;
unsigned int col=0, *rt;
short *sp;
char *cp, *cp1;
float u, v;
28. [Slide 28]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
SomeBlenderSnippets
Intro Why Blender? Black Box R&D Projects Showcase
Blender 2.50 (new trunk)
extern/bullet2/src/Bullet/ConstraintSolver/btConeConstraint.cpp
Lines 799-803
if (fabs(vSwingAxis.x()) > SIMD_EPSILON)
{
// nonzero twist?! this should never happen.
int wtf = 0; wtf = wtf;
}
source/blender/blenkernel/intern/library.c
Lines 801-802
/* this format specifier is fucked... */
sprintf(id>name+2, "%s.%0.3d", left, nr);
29. [Slide 29]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
SomeBlenderSnippets
Intro Why Blender? Black Box R&D Projects Showcase
Blender 2.66 (latest release)
extern/bullet2/src/LinearMath/btConvexHull.cpp
Lines 575-590
btAssert(v != 1);
btAssert(!isextreme[v]);
// wtf we've already done this vertex
isextreme[v]=1;
j=m_tris.size();
while(j) {
if(!m_tris[j]) continue; int3 t=*m_tris[j];
if(above(verts,t,verts[v],btScalar(0.01)*eps)) {
extrude(m_tris[j],v);
}
}
// now check for those degenerate cases where we
// have a flipped triangle or a really skinny
30. [Slide 30]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
UseBlenderinyourR&DProjects
Intro Why Blender? Black Box R&D Projects Showcase
1) External Realistic Rendering Engine.
2) Creation of Graphical Assets.
3) Blender Customization: Development
of Particularized Tools (Python Scripting).
4) Testing Suite (find Bugs!).
4 Good Uses:
31. [Slide 31]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Research&DevelopmentProjects
Intro Why Blender? Black Box R&D Projects Showcase
32. [Slide 32]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
MultiAgentRenderingOptimization
Intro Why Blender? Black Box R&D Projects Showcase
Input Bin
Input Bin
Input Bin
33. [Slide 33]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
MultiAgentRenderingOptimization
Intro Why Blender? Black Box R&D Projects Showcase
Geometry
Materials &
Textures
Light Sources
Particles
Others....
Input Bin
34. [Slide 34]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
MultiAgentRenderingOptimization
Intro Why Blender? Black Box R&D Projects Showcase
Geometry
Materials &
Textures
Light Sources
Particles
Others....
Input Bin
35. [Slide 35]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
MultiAgentRenderingOptimization
Intro Why Blender? Black Box R&D Projects Showcase
Input Bin
36. [Slide 36]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
MultiAgentRenderingOptimization
Intro Why Blender? Black Box R&D Projects Showcase
Ray Depth Light Samples
# Photons Use Cache
….
Config.
Parameters
Input Bin
37. [Slide 37]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
MultiAgentRenderingOptimization
Intro Why Blender? Black Box R&D Projects Showcase
After
some
Time
Working
Input Bin
38. [Slide 38]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
MultiAgentRenderingOptimization
Intro Why Blender? Black Box R&D Projects Showcase
Result
2D Image
After
some
Time
Input Bin
39. [Slide 39]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
MultiAgentRenderingOptimization
Intro Why Blender? Black Box R&D Projects Showcase
Result
2D Image
Input Bin
How
Much
Time?
42. RenderRender
TimeTime 4040hh
216216KK FramesFrames
Stereoscopic (Stereoscopic (×2)×2)
1.972 Years1.972 Years
[Slide 42]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Intro Why Blender? Black Box R&D Projects Showcase
43. RenderRender
TimeTime 4040hh
216216KK FramesFrames
Stereoscopic (Stereoscopic (×2)×2)
1.972 Years1.972 Years
a) 34.816 Coresa) 34.816 Cores
[Slide 43]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Intro Why Blender? Black Box R&D Projects Showcase
44. RenderRender
TimeTime 4040hh
216216KK FramesFrames
Stereoscopic (Stereoscopic (×2)×2)
1.972 Years1.972 Years
a) 34.816 Coresa) 34.816 Cores
b) Optimizationb) Optimization
[Slide 44]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Intro Why Blender? Black Box R&D Projects Showcase
45. [Slide 45]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
SpeedRenderingUp
Intro Why Blender? Black Box R&D Projects Showcase
Configuration
Parameters
Customization of
46. [Slide 46]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
SpeedRenderingUp
Intro Why Blender? Black Box R&D Projects Showcase
Configuration
Parameters
Customization of
Input Bin
Input Bin
Input BinInput Bin
Distributed Rendering
47. [Slide 47]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Objectives
Intro Why Blender? Black Box R&D Projects Showcase
Input Bin
Config. Param.
Combine the advantages of both approaches
Input Bin
Input Bin
Input Bin+
Customization of
Distributed Rendering
48. [Slide 48]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Objectives
Intro Why Blender? Black Box R&D Projects Showcase
Input Bin
Config. Param.
Combine the advantages of both approaches
Input Bin
Input Bin
Input Bin+
Customization of
Distributed Rendering
Modeling of
ExpertExpert
KnowledgeKnowledge
49. [Slide 49]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Objectives
Intro Why Blender? Black Box R&D Projects Showcase
Input Bin
Config. Param.
Combine the advantages of both approaches
Input Bin
Input Bin
Input Bin+
Customization of
Distributed Rendering
Modeling of
ExpertExpert
KnowledgeKnowledge
Inherent
ParallelParallel
ComputingComputing
50. [Slide 50]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
ProposedSolution
Intro Why Blender? Black Box R&D Projects Showcase
Local
Rendering
(1 agent)
51. [Slide 51]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
ProposedSolution
Intro Why Blender? Black Box R&D Projects Showcase
Local
Rendering
(1 agent)
MultiAgent
Rendering
52. Problem
Division 1
[Slide 52]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
ProposedSolution
Intro Why Blender? Black Box R&D Projects Showcase
Local
Rendering
(1 agent)
MultiAgent
Rendering
53. Problem
Division 1
[Slide 53]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
ProposedSolution
Intro Why Blender? Black Box R&D Projects Showcase
Local
Rendering
(1 agent)
MultiAgent
Rendering
Use Knowledge
(Local Optimization)
2
54. Problem
Division 1
[Slide 54]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
ProposedSolution
Intro Why Blender? Black Box R&D Projects Showcase
Local
Rendering
(1 agent)
MultiAgent
Rendering
Use Knowledge
(Local Optimization)
2
Combine
Results
3
55. Problem
Division 1
[Slide 55]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
ProposedSolution
Intro Why Blender? Black Box R&D Projects Showcase
MultiAgent
Rendering
Use Knowledge
(Local Optimization)
2
Combine
Results
3
MultiAgent
Architecture
Use of
Expert
Knowledge
Volunteer
Computing
Web Based!
56. [Slide 56]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
GeneralWorkflow
Intro Why Blender? Black Box R&D Projects Showcase
Scene Analysis
57. [Slide 57]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
ImportanceMap
Intro Why Blender? Black Box R&D Projects Showcase
Importance Map
Fast.
Approximation of
the complexity.
58. [Slide 58]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
ImportanceMap
Intro Why Blender? Black Box R&D Projects Showcase
Importance Map
Very complex
(Mirror + Reflact)
59. [Slide 59]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
ImportanceMap
Intro Why Blender? Black Box R&D Projects Showcase
Importance Map
Very complex
(Mirror + Reflact)
Simple zone
60. [Slide 61]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
GeneralWorkflow
Intro Why Blender? Black Box R&D Projects Showcase
Distributed Rendering
61. [Slide 62]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Results
Intro Why Blender? Black Box R&D Projects Showcase
16 Minutes. 8 Agents. B Opt.Level.121 Minutes. 1 Agent. No Opt.
Very different rendering times
with no noticeable changes.
62. [Slide 63]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Results
Intro Why Blender? Black Box R&D Projects Showcase
63. [Slide 64]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Intro Why Blender? Black Box R&D Projects Showcase
Ganas:TexttoSignLanguage
Automatic Synthesis of Sign
Language from written Spanish.
● Reusable Dictionary.
● Open Representation of Key
Poses.
● Facial and Corporal.
● Non Lineal Animation.
Dynamical blending by code.
64. [Slide 65]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Intro Why Blender? Black Box R&D Projects Showcase
Ganas:TexttoSignLanguage
65. [Slide 66]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
ConSignos:SpeechtoSignLanguage
Intro Why Blender? Black Box R&D Projects Showcase
Exporter
Automatic
Sing Editor
(Blender)
Skeletal
Animation
+
Sign Elements
DB
Manual
Sign
Creation
DB
Sign
Elements
Parametric Desc.
Configuration
List of Tokens
Sockets
Essential Description
Facial
Animation
66. [Slide 67]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
DesignoftheCharacters
Intro Why Blender? Black Box R&D Projects Showcase
67. [Slide 68]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
ConSignos:SpeechtoSignLanguage
Intro Why Blender? Black Box R&D Projects Showcase
69. [Slide 70]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Showcase:WeatherinC-LeónShowcase:WeatherinC-León
Intro Why Blender? Black Box R&D Projects Showcase
70.
[Slide 71]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Showcase:VirtualMuseum
Intro Why Blender? Black Box R&D Projects Showcase
Over 70 models.
Linux + OpenGL.
http://www.esi.uclm.es/museo/
71. [Slide 72]Carlos González Morcillo (Carlos.Gonzalez@uclm.es) – University of Castilla-La Mancha
Showcase:GameDevelopment
Intro Why Blender? Black Box R&D Projects Showcase
4 Free Books (over 1200
pages) on Game
Development with
Blender, C++, Ogre and
other free multiplatform
technologies.
72. Blender PT 2013
Porto (Portugal) · 6/7 April 2013
or... “Using Blender as an Integrated
Rendering Engine in R&D projects”