SlideShare a Scribd company logo
1 of 23
Download to read offline
Sponsored by
Space Time Varying
Color Palette
Bo ZHOU
J Cube Inc.
!
Paolo Berto Durrante
J Cube Inc.
Polygon Pictures Inc.
Sponsored bySA2015.SIGGRAPH.ORG
Introduction
Sponsored bySA2015.SIGGRAPH.ORG
Toon Rendering
no PBR
flat shading
artistic design
Sponsored bySA2015.SIGGRAPH.ORG
Color Palette
color matrix
object index
semantics
Sponsored bySA2015.SIGGRAPH.ORG
Color Palette
column
object index
row
semantics
lit color
shadow color
2nd shadow color
outline color etc.
Sponsored bySA2015.SIGGRAPH.ORG
Color Palette
Daylight Night Jungle Sunset
Sponsored bySA2015.SIGGRAPH.ORG
Color Palette
advantage
fast design
reusable
material/shading system independent
Sponsored bySA2015.SIGGRAPH.ORG
Color Palette
disadvantage
static color
predefined before rendering
Sponsored bySA2015.SIGGRAPH.ORG
Reality
Sponsored bySA2015.SIGGRAPH.ORG
Problem
Character was lit by both environment light
and visual effect elements.
Sponsored bySA2015.SIGGRAPH.ORG
Typical Workflow
create 2 color plattes
1 according environment and 2 for vfx
generate masks from renderer
fill the regions in post composition software
R = Lit, G
= Shadow,
Y =
Specular
Object Id
Sponsored bySA2015.SIGGRAPH.ORG
Typical Workflow
disadvantage
image was done in composition
software.
extra overhead on disk usage
more masks
not invertible
once geometry was changed, must
regenerate the all masks
Sponsored bySA2015.SIGGRAPH.ORG
Goal
finish the image in renderer
less disk usage
maximal flexibility as manual switching the
color palette in composition software
Sponsored bySA2015.SIGGRAPH.ORG
Solution
Sponsored bySA2015.SIGGRAPH.ORG
Solution
DAG network
a typed eventing network
time
space position
special light
…
generate dynamic code for specific network
independent from any renderer/software
what we want is a set of colors outputed from the network
constant statement will be optimised by compiler
Sponsored bySA2015.SIGGRAPH.ORG
Use Case
2 palettes, use the 1st between frame 1 - 4
but the rest associated with 2nd
Sponsored bySA2015.SIGGRAPH.ORG
Use Case
generated shader code
class jcubeToon5_PalettesCoShader_1()
{
uniform float num_rows = 5 ;
uniform float cell_size = 30 ;
uniform float border_size = 2 ;
!public uniform float has_light_event = 0 ;
!uniform string color_palettes[2] =
{
"/Users/Bo/Documents/maya/projects/default/sourceimages/Palette_A.tif" , // file2
"/Users/Bo/Documents/maya/projects/default/sourceimages/Palette_B.tif" // file1
};
!public void construct()
{
Gather( color_palettes[0] , cell_size , border_size , num_rows ) ;
Gather( color_palettes[1] , cell_size , border_size , num_rows ) ;
}
!//////////////////////////////////////////
public void surface( output color Ci , Oi ;
output color outputs[5] ;
uniform float float_index = - 1 ;
color color_index = 0 )
{
float choice = - 1 ;
! // jcubeToonNumericEvent1
//
float jcubeToonNumericEvent1_outputs = - 1 ;
uniform float jcubeToonNumericEvent1_first_term = 1.0 ;
uniform float jcubeToonNumericEvent1_second_term = 4.0 ;
uniform float jcubeToonNumericEvent1_if_palette = 0 ; // file2
uniform float jcubeToonNumericEvent1_else_palette = 1 ; // file1
if ( jcubeToonNumericEvent1_first_term > jcubeToonNumericEvent1_second_term )
{
jcubeToonNumericEvent1_outputs = jcubeToonNumericEvent1_if_palette ;
}
else
{
jcubeToonNumericEvent1_outputs = jcubeToonNumericEvent1_else_palette ;
}
choice = jcubeToonNumericEvent1_outputs ;
if ( float_index > - 1 )
{
Search( color_palettes[choice] , float_index , outputs ) ;
}
else
{
Search( color_palettes[choice] , color_index , outputs ) ;
}
}
}
Sponsored bySA2015.SIGGRAPH.ORG
Use Case
if (“P” in pCube1)
if (time > 4)
pick A
else
pick C
else
pick B
Sponsored bySA2015.SIGGRAPH.ORG
Use Case
class jcubeToon5_PalettesCoShader_1()
{
uniform float num_rows = 5 ;
uniform float cell_size = 30 ;
uniform float border_size = 2 ;
!public uniform float has_light_event = 0 ;
!uniform string color_palettes[3] =
{
"/Users/Bo/Documents/maya/projects/default/sourceimages/Palette_C.tif" , // file3
"/Users/Bo/Documents/maya/projects/default/sourceimages/Palette_A.tif" , // file2
"/Users/Bo/Documents/maya/projects/default/sourceimages/Palette_B.tif" // file1
};
!public void construct()
{
Gather( color_palettes[0] , cell_size , border_size , num_rows ) ;
Gather( color_palettes[1] , cell_size , border_size , num_rows ) ;
Gather( color_palettes[2] , cell_size , border_size , num_rows ) ;
}
!float inside_box( uniform point box_min , box_max ; point x )
{
if ( x[0] > box_min[0] && x[0] < box_max[0] )
if ( x[1] > box_min[1] && x[1] < box_max[1] )
if ( x[2] > box_min[2] && x[2] < box_max[2] )
return 1 ;
return 0 ;
}
!float inside_sphere( uniform point sphere_position ; uniform float sphere_radius ; point x )
{
if ( distance( x , sphere_position ) < sphere_radius )
return 1 ;
return 0 ;
}
!float inside_cone( uniform point cone_position ; uniform vector cone_direction ; uniform float cone_angle ; point x )
{
color a = transmission( cone_position , x , "samples" , 1 ) ;
float b = step( cos( radians( cone_angle ) * 0.5 ) , normalize( x - cone_position ) . normalize( cone_direction ) ) ;
return a[0] * b ;
}
!//////////////////////////////////////////
public void surface( output color Ci , Oi ;
output color outputs[5] ;
uniform float float_index = - 1 ;
color color_index = 0 )
{
point Pw = transform( "current" , "world" , P ) ;
!float choice = - 1 ;
!// jcubeToonNumericEvent1
//
float jcubeToonNumericEvent1_outputs = - 1 ;
uniform float jcubeToonNumericEvent1_first_term = 1.0 ;
uniform float jcubeToonNumericEvent1_second_term = 4.0 ;
uniform float jcubeToonNumericEvent1_if_palette = 1 ; // file2
uniform float jcubeToonNumericEvent1_else_palette = 2 ; // file1
if ( jcubeToonNumericEvent1_first_term > jcubeToonNumericEvent1_second_term )
{
jcubeToonNumericEvent1_outputs = jcubeToonNumericEvent1_if_palette ;
}
else
{
jcubeToonNumericEvent1_outputs = jcubeToonNumericEvent1_else_palette ;
}
// jcubeToonRegionEvent2
//
float jcubeToonRegionEvent2_outputs = - 1 ;
point jcubeToonRegionEvent2_Pw = Pw ;
float jcubeToonRegionEvent2_in_palette = jcubeToonNumericEvent1_outputs ; // jcubeToonNumericEvent1
uniform float jcubeToonRegionEvent2_out_palette = 0 ; // file3
uniform point jcubeToonRegionEvent2_box_min = point(-0.14332814514636993, 8.197878287319327e-08, -5.021854877471924) ;
uniform point jcubeToonRegionEvent2_box_max = point(2.2686707973480225, 7.261795997619629, -1.861090064048767) ;
if ( inside_box( jcubeToonRegionEvent2_box_min , jcubeToonRegionEvent2_box_max , jcubeToonRegionEvent2_Pw ) > 0 )
{
jcubeToonRegionEvent2_outputs = jcubeToonRegionEvent2_in_palette ;
}
else
{
jcubeToonRegionEvent2_outputs = jcubeToonRegionEvent2_out_palette ;
}
choice = jcubeToonRegionEvent2_outputs ;
if ( float_index > - 1 )
{
Search( color_palettes[choice] , float_index , outputs ) ;
}
else
{
Search( color_palettes[choice] , color_index , outputs ) ;
}
}
}
Sorry, a bit long then :)
Sponsored bySA2015.SIGGRAPH.ORG
Renderer
to the RSL-like renderer (3Delight)
generate coshader
invoked by shader as a black box
to the DSO renderer (mental ray)
generate LLVM JIT code
directly executed by shader as part of
the shader
Sponsored bySA2015.SIGGRAPH.ORG
Conclusion
advantage
reusable network for similar objects
much less composition work
cover all most any situations
space-varying or time-varying
Sponsored bySA2015.SIGGRAPH.ORG
Future
get rid of color palette completely
web+databased solution
abstract color palette
mapping semantics color to anything
replace color in cell with texture stream over
network
interactive feedback when changing palette
Sponsored bySA2015.SIGGRAPH.ORG
Thanks !
Q&A

More Related Content

What's hot

Intro to c chapter cover 1 4
Intro to c chapter cover 1 4Intro to c chapter cover 1 4
Intro to c chapter cover 1 4
Hazwan Arif
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
eShikshak
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
Mainak Sasmal
 

What's hot (20)

UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
 
Intro to c chapter cover 1 4
Intro to c chapter cover 1 4Intro to c chapter cover 1 4
Intro to c chapter cover 1 4
 
Input Output Management In C Programming
Input Output Management In C ProgrammingInput Output Management In C Programming
Input Output Management In C Programming
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
 
Programming in C [Module One]
Programming in C [Module One]Programming in C [Module One]
Programming in C [Module One]
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
C Programming Language Part 8
C Programming Language Part 8C Programming Language Part 8
C Programming Language Part 8
 
Unit2 C
Unit2 CUnit2 C
Unit2 C
 
Input And Output
 Input And Output Input And Output
Input And Output
 
Input output statement in C
Input output statement in CInput output statement in C
Input output statement in C
 
C Programming Language Part 9
C Programming Language Part 9C Programming Language Part 9
C Programming Language Part 9
 
7. input and output functions
7. input and output functions7. input and output functions
7. input and output functions
 
CPU INPUT OUTPUT
CPU INPUT OUTPUT CPU INPUT OUTPUT
CPU INPUT OUTPUT
 
Monads - Dublin Scala meetup
Monads - Dublin Scala meetupMonads - Dublin Scala meetup
Monads - Dublin Scala meetup
 
C Programming Language Part 4
C Programming Language Part 4C Programming Language Part 4
C Programming Language Part 4
 
Data Input and Output
Data Input and OutputData Input and Output
Data Input and Output
 
Basics of c
Basics of cBasics of c
Basics of c
 
Managing input and output operations in c
Managing input and output operations in cManaging input and output operations in c
Managing input and output operations in c
 
print even or odd number in c
print even or odd number in cprint even or odd number in c
print even or odd number in c
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
 

Viewers also liked

Information about planets and houses
Information about planets and housesInformation about planets and houses
Information about planets and houses
BASKARAN P
 
How to speak english fluently
How to speak english fluentlyHow to speak english fluently
How to speak english fluently
megacq
 

Viewers also liked (13)

Counseling & Mentoring
Counseling & MentoringCounseling & Mentoring
Counseling & Mentoring
 
Engaging e-Patients in a Digital World: How Collaboration, Transparency, and ...
Engaging e-Patients in a Digital World: How Collaboration, Transparency, and ...Engaging e-Patients in a Digital World: How Collaboration, Transparency, and ...
Engaging e-Patients in a Digital World: How Collaboration, Transparency, and ...
 
Legends Drive
Legends DriveLegends Drive
Legends Drive
 
Westport Intl
Westport IntlWestport Intl
Westport Intl
 
Whose Life Is It Anyway? Why Health Information Technology Must Serve Patients
Whose Life Is It Anyway? Why Health Information Technology Must Serve PatientsWhose Life Is It Anyway? Why Health Information Technology Must Serve Patients
Whose Life Is It Anyway? Why Health Information Technology Must Serve Patients
 
Sheena Golby - CV
Sheena Golby - CVSheena Golby - CV
Sheena Golby - CV
 
Engaging e-Patients in a Digital World
Engaging e-Patients in a Digital WorldEngaging e-Patients in a Digital World
Engaging e-Patients in a Digital World
 
10 ways to nurture your spiritual life
10 ways to nurture your spiritual life10 ways to nurture your spiritual life
10 ways to nurture your spiritual life
 
Samridhi
SamridhiSamridhi
Samridhi
 
Information about planets and houses
Information about planets and housesInformation about planets and houses
Information about planets and houses
 
Upsr workshop 2015 (target a) (1)
Upsr workshop 2015 (target a) (1)Upsr workshop 2015 (target a) (1)
Upsr workshop 2015 (target a) (1)
 
Experiencing beyond experience
Experiencing beyond experienceExperiencing beyond experience
Experiencing beyond experience
 
How to speak english fluently
How to speak english fluentlyHow to speak english fluently
How to speak english fluently
 

Similar to Space Time Varying Color Palettes

I wanna add the shape creator like rectangular , square , circle etc.pdf
I wanna add the shape creator like rectangular , square , circle etc.pdfI wanna add the shape creator like rectangular , square , circle etc.pdf
I wanna add the shape creator like rectangular , square , circle etc.pdf
herminaherman
 
java compilerCompiler1.javajava compilerCompiler1.javaimport.docx
java compilerCompiler1.javajava compilerCompiler1.javaimport.docxjava compilerCompiler1.javajava compilerCompiler1.javaimport.docx
java compilerCompiler1.javajava compilerCompiler1.javaimport.docx
priestmanmable
 
Functional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsFunctional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event Systems
Leonardo Borges
 
Javascript 基础
Javascript 基础Javascript 基础
Javascript 基础
Alipay
 
Matlab 3
Matlab 3Matlab 3
Matlab 3
asguna
 
Mdp plus 2.1
Mdp plus 2.1Mdp plus 2.1
Mdp plus 2.1
boedax
 

Similar to Space Time Varying Color Palettes (20)

Functional Programming 101 with Scala and ZIO @FunctionalWorld
Functional Programming 101 with Scala and ZIO @FunctionalWorldFunctional Programming 101 with Scala and ZIO @FunctionalWorld
Functional Programming 101 with Scala and ZIO @FunctionalWorld
 
【Unite 2017 Tokyo】シェーダープログラミング入門!カスタムシェーダー、作るで!
【Unite 2017 Tokyo】シェーダープログラミング入門!カスタムシェーダー、作るで!【Unite 2017 Tokyo】シェーダープログラミング入門!カスタムシェーダー、作るで!
【Unite 2017 Tokyo】シェーダープログラミング入門!カスタムシェーダー、作るで!
 
I wanna add the shape creator like rectangular , square , circle etc.pdf
I wanna add the shape creator like rectangular , square , circle etc.pdfI wanna add the shape creator like rectangular , square , circle etc.pdf
I wanna add the shape creator like rectangular , square , circle etc.pdf
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesAdvanced Debugging Using Java Bytecodes
Advanced Debugging Using Java Bytecodes
 
java compilerCompiler1.javajava compilerCompiler1.javaimport.docx
java compilerCompiler1.javajava compilerCompiler1.javaimport.docxjava compilerCompiler1.javajava compilerCompiler1.javaimport.docx
java compilerCompiler1.javajava compilerCompiler1.javaimport.docx
 
Implementing the IO Monad in Scala
Implementing the IO Monad in ScalaImplementing the IO Monad in Scala
Implementing the IO Monad in Scala
 
Exact Real Arithmetic for Tcl
Exact Real Arithmetic for TclExact Real Arithmetic for Tcl
Exact Real Arithmetic for Tcl
 
67WS Seminar Event
67WS Seminar Event67WS Seminar Event
67WS Seminar Event
 
Functional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsFunctional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event Systems
 
C Programming Storage classes, Recursion
C Programming Storage classes, RecursionC Programming Storage classes, Recursion
C Programming Storage classes, Recursion
 
Javascript 基础
Javascript 基础Javascript 基础
Javascript 基础
 
Interesting facts on c
Interesting facts on cInteresting facts on c
Interesting facts on c
 
Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015
 
OpenGL SC 2.0 Quick Reference
OpenGL SC 2.0 Quick ReferenceOpenGL SC 2.0 Quick Reference
OpenGL SC 2.0 Quick Reference
 
VkRunner: a Vulkan shader test tool (FOSDEM 2019)
VkRunner: a Vulkan shader test tool (FOSDEM 2019)VkRunner: a Vulkan shader test tool (FOSDEM 2019)
VkRunner: a Vulkan shader test tool (FOSDEM 2019)
 
Scala Under the Hood / ScalaSwarm
Scala Under the Hood / ScalaSwarmScala Under the Hood / ScalaSwarm
Scala Under the Hood / ScalaSwarm
 
Neural Network - Feed Forward - Back Propagation Visualization
Neural Network - Feed Forward - Back Propagation VisualizationNeural Network - Feed Forward - Back Propagation Visualization
Neural Network - Feed Forward - Back Propagation Visualization
 
Fpga 04-verilog-programming
Fpga 04-verilog-programmingFpga 04-verilog-programming
Fpga 04-verilog-programming
 
Matlab 3
Matlab 3Matlab 3
Matlab 3
 
Mdp plus 2.1
Mdp plus 2.1Mdp plus 2.1
Mdp plus 2.1
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Space Time Varying Color Palettes

  • 1. Sponsored by Space Time Varying Color Palette Bo ZHOU J Cube Inc. ! Paolo Berto Durrante J Cube Inc. Polygon Pictures Inc.
  • 3. Sponsored bySA2015.SIGGRAPH.ORG Toon Rendering no PBR flat shading artistic design
  • 5. Sponsored bySA2015.SIGGRAPH.ORG Color Palette column object index row semantics lit color shadow color 2nd shadow color outline color etc.
  • 7. Sponsored bySA2015.SIGGRAPH.ORG Color Palette advantage fast design reusable material/shading system independent
  • 10. Sponsored bySA2015.SIGGRAPH.ORG Problem Character was lit by both environment light and visual effect elements.
  • 11. Sponsored bySA2015.SIGGRAPH.ORG Typical Workflow create 2 color plattes 1 according environment and 2 for vfx generate masks from renderer fill the regions in post composition software R = Lit, G = Shadow, Y = Specular Object Id
  • 12. Sponsored bySA2015.SIGGRAPH.ORG Typical Workflow disadvantage image was done in composition software. extra overhead on disk usage more masks not invertible once geometry was changed, must regenerate the all masks
  • 13. Sponsored bySA2015.SIGGRAPH.ORG Goal finish the image in renderer less disk usage maximal flexibility as manual switching the color palette in composition software
  • 15. Sponsored bySA2015.SIGGRAPH.ORG Solution DAG network a typed eventing network time space position special light … generate dynamic code for specific network independent from any renderer/software what we want is a set of colors outputed from the network constant statement will be optimised by compiler
  • 16. Sponsored bySA2015.SIGGRAPH.ORG Use Case 2 palettes, use the 1st between frame 1 - 4 but the rest associated with 2nd
  • 17. Sponsored bySA2015.SIGGRAPH.ORG Use Case generated shader code class jcubeToon5_PalettesCoShader_1() { uniform float num_rows = 5 ; uniform float cell_size = 30 ; uniform float border_size = 2 ; !public uniform float has_light_event = 0 ; !uniform string color_palettes[2] = { "/Users/Bo/Documents/maya/projects/default/sourceimages/Palette_A.tif" , // file2 "/Users/Bo/Documents/maya/projects/default/sourceimages/Palette_B.tif" // file1 }; !public void construct() { Gather( color_palettes[0] , cell_size , border_size , num_rows ) ; Gather( color_palettes[1] , cell_size , border_size , num_rows ) ; } !////////////////////////////////////////// public void surface( output color Ci , Oi ; output color outputs[5] ; uniform float float_index = - 1 ; color color_index = 0 ) { float choice = - 1 ; ! // jcubeToonNumericEvent1 // float jcubeToonNumericEvent1_outputs = - 1 ; uniform float jcubeToonNumericEvent1_first_term = 1.0 ; uniform float jcubeToonNumericEvent1_second_term = 4.0 ; uniform float jcubeToonNumericEvent1_if_palette = 0 ; // file2 uniform float jcubeToonNumericEvent1_else_palette = 1 ; // file1 if ( jcubeToonNumericEvent1_first_term > jcubeToonNumericEvent1_second_term ) { jcubeToonNumericEvent1_outputs = jcubeToonNumericEvent1_if_palette ; } else { jcubeToonNumericEvent1_outputs = jcubeToonNumericEvent1_else_palette ; } choice = jcubeToonNumericEvent1_outputs ; if ( float_index > - 1 ) { Search( color_palettes[choice] , float_index , outputs ) ; } else { Search( color_palettes[choice] , color_index , outputs ) ; } } }
  • 18. Sponsored bySA2015.SIGGRAPH.ORG Use Case if (“P” in pCube1) if (time > 4) pick A else pick C else pick B
  • 19. Sponsored bySA2015.SIGGRAPH.ORG Use Case class jcubeToon5_PalettesCoShader_1() { uniform float num_rows = 5 ; uniform float cell_size = 30 ; uniform float border_size = 2 ; !public uniform float has_light_event = 0 ; !uniform string color_palettes[3] = { "/Users/Bo/Documents/maya/projects/default/sourceimages/Palette_C.tif" , // file3 "/Users/Bo/Documents/maya/projects/default/sourceimages/Palette_A.tif" , // file2 "/Users/Bo/Documents/maya/projects/default/sourceimages/Palette_B.tif" // file1 }; !public void construct() { Gather( color_palettes[0] , cell_size , border_size , num_rows ) ; Gather( color_palettes[1] , cell_size , border_size , num_rows ) ; Gather( color_palettes[2] , cell_size , border_size , num_rows ) ; } !float inside_box( uniform point box_min , box_max ; point x ) { if ( x[0] > box_min[0] && x[0] < box_max[0] ) if ( x[1] > box_min[1] && x[1] < box_max[1] ) if ( x[2] > box_min[2] && x[2] < box_max[2] ) return 1 ; return 0 ; } !float inside_sphere( uniform point sphere_position ; uniform float sphere_radius ; point x ) { if ( distance( x , sphere_position ) < sphere_radius ) return 1 ; return 0 ; } !float inside_cone( uniform point cone_position ; uniform vector cone_direction ; uniform float cone_angle ; point x ) { color a = transmission( cone_position , x , "samples" , 1 ) ; float b = step( cos( radians( cone_angle ) * 0.5 ) , normalize( x - cone_position ) . normalize( cone_direction ) ) ; return a[0] * b ; } !////////////////////////////////////////// public void surface( output color Ci , Oi ; output color outputs[5] ; uniform float float_index = - 1 ; color color_index = 0 ) { point Pw = transform( "current" , "world" , P ) ; !float choice = - 1 ; !// jcubeToonNumericEvent1 // float jcubeToonNumericEvent1_outputs = - 1 ; uniform float jcubeToonNumericEvent1_first_term = 1.0 ; uniform float jcubeToonNumericEvent1_second_term = 4.0 ; uniform float jcubeToonNumericEvent1_if_palette = 1 ; // file2 uniform float jcubeToonNumericEvent1_else_palette = 2 ; // file1 if ( jcubeToonNumericEvent1_first_term > jcubeToonNumericEvent1_second_term ) { jcubeToonNumericEvent1_outputs = jcubeToonNumericEvent1_if_palette ; } else { jcubeToonNumericEvent1_outputs = jcubeToonNumericEvent1_else_palette ; } // jcubeToonRegionEvent2 // float jcubeToonRegionEvent2_outputs = - 1 ; point jcubeToonRegionEvent2_Pw = Pw ; float jcubeToonRegionEvent2_in_palette = jcubeToonNumericEvent1_outputs ; // jcubeToonNumericEvent1 uniform float jcubeToonRegionEvent2_out_palette = 0 ; // file3 uniform point jcubeToonRegionEvent2_box_min = point(-0.14332814514636993, 8.197878287319327e-08, -5.021854877471924) ; uniform point jcubeToonRegionEvent2_box_max = point(2.2686707973480225, 7.261795997619629, -1.861090064048767) ; if ( inside_box( jcubeToonRegionEvent2_box_min , jcubeToonRegionEvent2_box_max , jcubeToonRegionEvent2_Pw ) > 0 ) { jcubeToonRegionEvent2_outputs = jcubeToonRegionEvent2_in_palette ; } else { jcubeToonRegionEvent2_outputs = jcubeToonRegionEvent2_out_palette ; } choice = jcubeToonRegionEvent2_outputs ; if ( float_index > - 1 ) { Search( color_palettes[choice] , float_index , outputs ) ; } else { Search( color_palettes[choice] , color_index , outputs ) ; } } } Sorry, a bit long then :)
  • 20. Sponsored bySA2015.SIGGRAPH.ORG Renderer to the RSL-like renderer (3Delight) generate coshader invoked by shader as a black box to the DSO renderer (mental ray) generate LLVM JIT code directly executed by shader as part of the shader
  • 21. Sponsored bySA2015.SIGGRAPH.ORG Conclusion advantage reusable network for similar objects much less composition work cover all most any situations space-varying or time-varying
  • 22. Sponsored bySA2015.SIGGRAPH.ORG Future get rid of color palette completely web+databased solution abstract color palette mapping semantics color to anything replace color in cell with texture stream over network interactive feedback when changing palette