<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-20458951</id><updated>2012-01-07T19:07:24.654-08:00</updated><title type='text'>RenderMonkey</title><subtitle type='html'>Esse Blog `e dedicado a ajudar e trocar experiencias sobre RSL . Dicas sugestoes e tutoriais sao bem vindos .
sou um aprendiz de RSL portanto desculpe qualquer engano  publicado aqui</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-20458951.post-1712925742930624785</id><published>2011-12-25T14:45:00.001-08:00</published><updated>2011-12-26T10:07:33.985-08:00</updated><title type='text'>Spherical Harmonics</title><content type='html'>&lt;div&gt;&lt;ul&gt;&lt;li&gt;Spherical Harmonics com e sem Occ&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href="http://4.bp.blogspot.com/-ZX0FEGO5h4M/Tve2L5lbgSI/AAAAAAAAAG4/ALdmnFVq22Y/s1600/cathedralWithOcc.tif"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px; height: 150px;" src="http://4.bp.blogspot.com/-ZX0FEGO5h4M/Tve2L5lbgSI/AAAAAAAAAG4/ALdmnFVq22Y/s200/cathedralWithOcc.tif" border="0" alt="" id="BLOGGER_PHOTO_ID_5690216969758540066" /&gt;&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://2.bp.blogspot.com/-sRfqHBKqq0U/Tve2LnPCtkI/AAAAAAAAAGs/oWMfRsj0uWo/s1600/cathedralNoOcc.tif"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px; height: 150px;" src="http://2.bp.blogspot.com/-sRfqHBKqq0U/Tve2LnPCtkI/AAAAAAAAAGs/oWMfRsj0uWo/s200/cathedralNoOcc.tif" border="0" alt="" id="BLOGGER_PHOTO_ID_5690216964832802370" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;div style="text-align: right;"&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: medium; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: medium; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: medium; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: medium; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: medium; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: medium; "&gt;Spherical Harmonics eh uma tecnica usada muito em games para criar falsa iluminacao ambiente nos objetos , ele dispensa o uso de HDRI para simular a irradiancia sobre o difuse de um shader , apesar da matematica envolvida ser cheio de letras e numeros malucos a aplicacao eh bem simples usando um pouco a ajuda e o programa do paper :&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://graphics.stanford.edu/papers/envmap/"&gt;&lt;span&gt;http://graphics.stanford.edu/papers/envmap/&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;esse paper explica que voce pode pegar todos os valores de "luma"!!! :P atraves de 9 coeficientes processados de um mapa de HDR .. esses coeficientes sao depois multiplicados sobre o diffuse&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;a formula eh isso aqui :&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="p1"&gt;&lt;/p&gt;&lt;p class="p1"&gt;&lt;span&gt;&lt;span class="Apple-tab-span"&gt;&lt;/span&gt;vector DiffuseColor = vector ( C1 * L22 * (tnorm[0] * tnorm[0] - tnorm[1] * tnorm[1]) +C3 * L20 * tnorm[2] * tnorm[2] +C4 * L00 -C5 * L20 +2.0 * C1 * L2m2 * tnorm[0] * tnorm[1] +2.0 * C1 * L21 * tnorm[0] * tnorm[2]+2.0 * C1 * L2m1 * tnorm[1] * tnorm[2] +2.0 * C2 * L11 * tnorm[0] +2.0 * C2 * L1m1 * tnorm[1] + 2.0 * C2 * L10 * tnorm[2] );&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;span&gt;&lt;span style="text-align: justify; "&gt;onde cada c1 c2 c3 etc .. sao numeros constantes indicados no paper .. e o L22 L11 etc .. sao coeficientes processados do HDRI ... existe uma tabela de mapas HDRI mais conhecidos para ser usados de exemplo .. o que eu usei eh o mapa&lt;/span&gt;&lt;span style="text-align: justify; "&gt; &lt;/span&gt;&lt;span style="text-align: justify; "&gt;Grace cathedral , c for preciso novos coficientes de mapas propios . o paper fornece um codigo em "C" que extrai os coeficientes para voce de um novo mapa , nao testei ainda . mas acho que eh possivel transformar esse codigo em um DSO para o renderman . assim extrair o coeficiente em renderTime c for o caso ... aqui vai a tabela :&lt;/span&gt;&lt;a href="http://www.yaldex.com/open-gl/images/12tab01.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 500px; height: 611px;" src="http://www.yaldex.com/open-gl/images/12tab01.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;um detalhe, como essa eh uma tecnica para produzir luz ambiente . ela nao gera sombra,  alguns papers na net demonstram outras formas de usar esse calculo para retirar &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;o sample de cor pra producao de bleeding e sombras usando raytracing . mas basicamente &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;eh um looping de gather conferindo onde o raio obteve ou nao  colisao , caso nao , ele utiliza o spherical harmonic para produzir o occlsuion , aqui . eu usei um simples occlusion do renderman para produzir isso.  detalhe spherical harmonics pode ser usados tbm na composicao .. caso voce tenha um pass de normal  ... no video "&lt;span&gt;&lt;span style="line-height: 19px; "&gt;Nuke master Class de Roy Stelzer" encontrado no propio site da Foundry .. ele demonstra como aplicar isso ..&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;span&gt;&lt;span style="line-height: 19px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;span&gt;&lt;span style="line-height: 19px; "&gt;bem segue o codigo do shader :&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;span&gt;&lt;span style="line-height: 19px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;&lt;br class="Apple-interchange-newline"&gt;surface  spherical(float scalefactor = .2 , samples = 32 , occOnOff = 0.0)&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;{&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;// spherical harmonics coeficients&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        float C1 = 0.429043;&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        float C2 = 0.511664;&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        float C3 = 0.743125;&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        float C4 = 0.886227;&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        float C5 = 0.247708;&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;// Constants for Old Town Square lighting&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        vector L00  = vector( .79,  .44,  0.54);&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        vector L1m1 = vector( 0.39,  0.35,  0.60);&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        vector L10  = vector( -0.34,  -0.18, -0.27);&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        vector L11  = vector(-0.29, -0.06, .01);&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        vector L2m2 = vector(-0.11, -0.05, -0.12);&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        vector L2m1 = vector( -0.26,  -0.22,  -0.47);&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        vector L20  = vector(-0.16, -0.09, -0.15);&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        vector L21  = vector(0.56, 0.21, .14);&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        vector L22  = vector(.21, -0.05, -0.30);&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        vector tnorm = vector(faceforward(normalize(N),I));&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        vector DiffuseColor = vector ( C1 * L22 * (tnorm[0] * tnorm[0] - tnorm[1] * tnorm[1]) +&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        C3 * L20 * tnorm[2] * tnorm[2] +C4 * L00 -&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        C5 * L20 +&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        2.0 * C1 * L2m2 * tnorm[0] * tnorm[1] +&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        2.0 * C1 * L21  * tnorm[0] * tnorm[2]+&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        2.0 * C1 * L2m1 * tnorm[1] * tnorm[2] +&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        2.0 * C2 * L11  * tnorm[0] +&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        2.0 * C2 * L1m1 * tnorm[1] +  &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        2.0 * C2 * L10  * tnorm[2] );&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;//occlusion&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        float average;&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        normal  n = normalize(N),&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        nf = faceforward(n, I);&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        float   hits = 0;&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        if(occOnOff != 0.0)&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        {&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;                gather("illuminance", P, nf, PI/2, samples, "distribution","cosine")&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;                {&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;                        hits += 1;&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;                }&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;                average = hits / samples;&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        }&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        else   &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        {&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;                average = 0;&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        }&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;       &lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        Ci = (color(DiffuseColor * scalefactor)) - average;&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(229, 229, 229); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;        Oi = 1;&lt;/div&gt;&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 4px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: bold; font-size: 13px; font-family: monospace; vertical-align: baseline; list-style-type: decimal; list-style-position: initial; list-style-image: initial; color: rgb(85, 85, 85); line-height: 13px; background-color: rgb(252, 252, 252); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; vertical-align: baseline; "&gt;}&lt;/div&gt;&lt;/li&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;span&gt;&lt;span style="line-height: 19px; "&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;span&gt;&lt;span style="line-height: 19px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;p class="p1" style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="p1" style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-1712925742930624785?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/1712925742930624785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=1712925742930624785' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/1712925742930624785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/1712925742930624785'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2011/12/spherical-harmonics.html' title='Spherical Harmonics'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-ZX0FEGO5h4M/Tve2L5lbgSI/AAAAAAAAAG4/ALdmnFVq22Y/s72-c/cathedralWithOcc.tif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-319403383672889935</id><published>2011-10-31T14:55:00.000-07:00</published><updated>2011-10-31T15:47:41.423-07:00</updated><title type='text'>subSurface</title><content type='html'>Fiz um teste de shader de SSS no 3delight .. modelo e texturas nao sao meus  ("&lt;a href="http://www.ir-ltd.net/infinite-3d-head-scan-released"&gt;http://www.ir-ltd.net/infinite-3d-head-scan-released&lt;/a&gt;) somente fiz a combinação de dois shader no maya  cook torrance  com SSS tanto no specular quanto no difusse ! e detalhes com displace ao invez de normal map .. o resultado ficou bem legal . levando em conta o pouco que precisei mexer nos shader pro resultado final ! mas tenho que admitir que o modelo e as texturas sao tao bons que mesmo um maya software tira um render bem aceitavel com esse modelo "D ..&lt;div&gt;&lt;img style="cursor:pointer; cursor:hand;width: 344px; height: 400px;" src="http://4.bp.blogspot.com/-GnMz0IShaRE/Tq8ledIdQKI/AAAAAAAAAGI/ztiurFE8mqE/s400/sssSkinShaderTest.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5669791661029146786" /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-319403383672889935?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/319403383672889935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=319403383672889935' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/319403383672889935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/319403383672889935'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2011/10/subsurface.html' title='subSurface'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-GnMz0IShaRE/Tq8ledIdQKI/AAAAAAAAAGI/ztiurFE8mqE/s72-c/sssSkinShaderTest.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-6032888048303044202</id><published>2011-08-30T19:33:00.000-07:00</published><updated>2011-08-30T19:41:09.183-07:00</updated><title type='text'>Procedural Primitives 2</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/-PbwpOxPOZRE/Tl2eI4gbTWI/AAAAAAAAAFc/co-2ZhsNIbs/s1600/RiProcedural_002_CHR_basicRenderPass.tif" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://2.bp.blogspot.com/-PbwpOxPOZRE/Tl2eI4gbTWI/AAAAAAAAAFc/co-2ZhsNIbs/s400/RiProcedural_002_CHR_basicRenderPass.tif" border="0" alt="" id="BLOGGER_PHOTO_ID_5646843383237004642" /&gt;&lt;/a&gt;&lt;br /&gt;Depois de brigar um pouco com o c++ consegui "traduzir" mais um exemplo de procedural&lt;br /&gt;primitives  que vi em python  para a linguagem c++ , dessa vez usando um exemplo de como gerar esferas dispostas aleatoriamente ao redor de uma esfera maior .&lt;div&gt;o codigo praticamente o mesmo&lt;/div&gt;&lt;div&gt;do exemplo anterior . com a diferenca&lt;/div&gt;&lt;div&gt;da adicao de funcoes para sortear posicoes aleatorias e normalizacao dessas posicoes para chegar no formato da esfera maior , segue abaixo o codigo &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;header:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;        &lt;p class="p1"&gt;/*&lt;/p&gt; &lt;p class="p1"&gt; *  RibBox.h&lt;/p&gt; &lt;p class="p1"&gt; *  classExerc&lt;/p&gt; &lt;p class="p1"&gt; *&lt;/p&gt; &lt;p class="p1"&gt; *  Created by chrysl666 on 8/27/11.&lt;/p&gt; &lt;p class="p1"&gt; *  Copyright 2011 none. All rights reserved.&lt;/p&gt; &lt;p class="p1"&gt; *&lt;/p&gt; &lt;p class="p1"&gt; */&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p3"&gt;#ifndef RIBBOX_H&lt;/p&gt; &lt;p class="p3"&gt;#define RIBBOX_H&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p3"&gt;#include &lt;span class="s1"&gt;&lt;vector&gt;&lt;/vector&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="p3"&gt;#include &lt;span class="s1"&gt;&lt;string&gt;&lt;/string&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="s2"&gt;int&lt;/span&gt;&lt;span class="s3"&gt; &lt;/span&gt;&lt;span class="s2"&gt;const&lt;/span&gt;&lt;span class="s3"&gt; &lt;/span&gt;VECTOR_SIZE&lt;span class="s3"&gt; = &lt;/span&gt;&lt;span class="s4"&gt;3&lt;/span&gt;&lt;span class="s3"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="s2"&gt;class&lt;/span&gt; RibBox&lt;/p&gt; &lt;p class="p5"&gt;{&lt;/p&gt; &lt;p class="p6"&gt;public&lt;span class="s3"&gt;:&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;//constructor&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;RibBox();&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;//variaveis&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s5"&gt;string&lt;/span&gt;&lt;span class="s3"&gt; parFromMaya ;&lt;/span&gt;//&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;sent by renderman&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s5"&gt;string&lt;/span&gt;&lt;span class="s3"&gt; details ;&lt;/span&gt;//&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;got from splited[0]&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s5"&gt;string&lt;/span&gt;&lt;span class="s3"&gt; number ;&lt;/span&gt;//&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;got from splited[1]&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s5"&gt;string&lt;/span&gt;&lt;span class="s3"&gt; width ;&lt;/span&gt;//&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;got from splited[2]&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s5"&gt;string&lt;/span&gt;&lt;span class="s3"&gt; radius ;&lt;/span&gt;//&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;got from splited[3]&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class="s2"&gt;double&lt;/span&gt;&lt;span class="s3"&gt; &lt;/span&gt;&lt;span class="s6"&gt;point&lt;/span&gt;&lt;span class="s3"&gt;[&lt;/span&gt;&lt;span class="s6"&gt;VECTOR_SIZE&lt;/span&gt;&lt;span class="s3"&gt;];&lt;/span&gt;//&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;ponto aleatorio&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class="s2"&gt;double&lt;/span&gt;&lt;span class="s3"&gt; &lt;/span&gt;&lt;span class="s6"&gt;normPoint&lt;/span&gt;&lt;span class="s3"&gt;[&lt;/span&gt;&lt;span class="s6"&gt;VECTOR_SIZE&lt;/span&gt;&lt;span class="s3"&gt;];&lt;/span&gt;//&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;ponto apos normalizado&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class="s2"&gt;double&lt;/span&gt;&lt;span class="s3"&gt; &lt;/span&gt;&lt;span class="s6"&gt;scalePnt&lt;/span&gt;&lt;span class="s3"&gt;[&lt;/span&gt;&lt;span class="s6"&gt;VECTOR_SIZE&lt;/span&gt;&lt;span class="s3"&gt;];&lt;/span&gt;//&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;ponto apos scalado&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;//funcoes&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class="s2"&gt;void&lt;/span&gt;&lt;span class="s3"&gt; setRibBox();&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// insert commands at render  stream&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class="s2"&gt;void&lt;/span&gt;&lt;span class="s3"&gt; getRibBoxPar();&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// get par from renderman&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s2"&gt;void&lt;/span&gt; Tokenize(&lt;span class="s2"&gt;const&lt;/span&gt; std::&lt;span class="s5"&gt;string&lt;/span&gt;&amp;amp; ,&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;  std::&lt;span class="s5"&gt;vector&lt;/span&gt;&lt;std::&lt;span class="s5"&gt;string&amp;gt;&amp;amp; ,&lt;/std::&lt;span&gt;&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;  &lt;span class="s2"&gt;const&lt;/span&gt; std::&lt;span class="s5"&gt;string&lt;/span&gt;&amp;amp; ); &lt;span class="s7"&gt;//tokenize&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s2"&gt;void&lt;/span&gt; randomPoint(&lt;span class="s2"&gt;double&lt;/span&gt; rangeMin, &lt;span class="s2"&gt;double&lt;/span&gt; rangeMax );&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s5"&gt;string&lt;/span&gt; formatTuple(std::&lt;span class="s5"&gt;string&lt;/span&gt; theTuple);&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s2"&gt;void&lt;/span&gt; scalePoint();&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s2"&gt;void&lt;/span&gt; normalize();&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s2"&gt;double&lt;/span&gt;  randWidth(std::&lt;span class="s5"&gt;string&lt;/span&gt; max);&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;     &lt;/p&gt; &lt;p class="p5"&gt;};&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p3"&gt;#endif&lt;/p&gt;&lt;p class="p3"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="p3"&gt;cpp:&lt;/p&gt;&lt;p class="p3"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="p3"&gt;        &lt;/p&gt;&lt;p class="p1"&gt;/*&lt;/p&gt; &lt;p class="p1"&gt; *  RibBox.cpp&lt;/p&gt; &lt;p class="p1"&gt; *  classExerc&lt;/p&gt; &lt;p class="p1"&gt; *&lt;/p&gt; &lt;p class="p1"&gt; *  Created by chrysl666 on 8/27/11.&lt;/p&gt; &lt;p class="p1"&gt; *  Copyright 2011 none. All rights reserved.&lt;/p&gt; &lt;p class="p1"&gt; *&lt;/p&gt; &lt;p class="p1"&gt; */&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="s1"&gt;#include &lt;/span&gt;&lt;iostream&gt;&lt;/iostream&gt;&lt;/p&gt; &lt;p class="p4"&gt;#include &lt;span class="s2"&gt;&lt;vector&gt;&lt;/vector&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="p4"&gt;#include &lt;span class="s2"&gt;&lt;string&gt;&lt;/string&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="p4"&gt;#include &lt;span class="s2"&gt;&lt;cstdlib&gt;&lt;/cstdlib&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="p4"&gt;#include &lt;span class="s2"&gt;&lt;cmath&gt;&lt;/cmath&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="s1"&gt;#include &lt;/span&gt;"RibBox.h"&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p5"&gt;RibBox&lt;span class="s3"&gt;::&lt;/span&gt;RibBox&lt;span class="s3"&gt;()&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;{&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// construtor da classe&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;//incializa o array point&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s4"&gt;for&lt;/span&gt;(&lt;span class="s4"&gt;int&lt;/span&gt; i=&lt;span class="s5"&gt;0&lt;/span&gt;;i&amp;lt;&lt;span class="s5"&gt;3&lt;/span&gt;;i++)&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;{&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;point[i]=&lt;span class="s5"&gt;0&lt;/span&gt;;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;}&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p6"&gt;}&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s4"&gt;void&lt;/span&gt; &lt;span class="s6"&gt;RibBox&lt;/span&gt;::Tokenize(&lt;span class="s4"&gt;const&lt;/span&gt; std::&lt;span class="s7"&gt;string&lt;/span&gt;&amp;amp; str,&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;  std::&lt;span class="s7"&gt;vector&lt;/span&gt;&lt;std::&lt;span class="s7"&gt;string&amp;gt;&amp;amp; tokens,&lt;/std::&lt;span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;  &lt;span class="s4"&gt;const&lt;/span&gt; std::&lt;span class="s7"&gt;string&lt;/span&gt;&amp;amp; delimiters = &lt;span class="s2"&gt;" "&lt;/span&gt;)&lt;/p&gt; &lt;p class="p6"&gt;{&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// tokenize function para separar as informacoes em strings&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// pula o delimitadores no inicio&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s7"&gt;string&lt;/span&gt;::&lt;span class="s7"&gt;size_type&lt;/span&gt; lastPos = str.&lt;span class="s7"&gt;find_first_not_of&lt;/span&gt;(delimiters, &lt;span class="s5"&gt;0&lt;/span&gt;);&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// acha o primeiro nao delimitador&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s7"&gt;string&lt;/span&gt;::&lt;span class="s7"&gt;size_type&lt;/span&gt; pos     = str.&lt;span class="s7"&gt;find_first_of&lt;/span&gt;(delimiters, lastPos);&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;    &lt;span class="s4"&gt;while&lt;/span&gt; (std::&lt;span class="s7"&gt;string&lt;/span&gt;::&lt;span class="s7"&gt;npos&lt;/span&gt; != pos || std::&lt;span class="s7"&gt;string&lt;/span&gt;::&lt;span class="s7"&gt;npos&lt;/span&gt; != lastPos)&lt;/p&gt; &lt;p class="p6"&gt;    {&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// achou um token , add no vetor.&lt;/p&gt; &lt;p class="p6"&gt;        tokens.&lt;span class="s7"&gt;push_back&lt;/span&gt;(str.&lt;span class="s7"&gt;substr&lt;/span&gt;(lastPos, pos - lastPos));&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// pula delimitadores.  Note o "nao_de"&lt;/p&gt; &lt;p class="p6"&gt;        lastPos = str.&lt;span class="s7"&gt;find_first_not_of&lt;/span&gt;(delimiters, pos);&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// procura proximo "nao-delimitador"&lt;/p&gt; &lt;p class="p6"&gt;        pos = str.&lt;span class="s7"&gt;find_first_of&lt;/span&gt;(delimiters, lastPos);&lt;/p&gt; &lt;p class="p6"&gt;    }&lt;/p&gt; &lt;p class="p6"&gt;}&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s4"&gt;void&lt;/span&gt; &lt;span class="s6"&gt;RibBox&lt;/span&gt;::getRibBoxPar()&lt;/p&gt; &lt;p class="p6"&gt;{&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;//parsing comandos vindos dos renderman&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s7"&gt;vector&lt;/span&gt;&lt;span class="s3"&gt;&lt;std::&lt; span=""&gt;&lt;span class="s7"&gt;string&lt;/span&gt;&lt;span class="s3"&gt;&amp;gt; tokens; &lt;/span&gt;// um vector de string temporario&lt;/std::&lt;&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s7"&gt;getline&lt;/span&gt;(std::&lt;span class="s7"&gt;cin&lt;/span&gt;,parFromMaya);&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s6"&gt;Tokenize&lt;/span&gt;(parFromMaya ,tokens);&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;details = tokens[&lt;span class="s5"&gt;0&lt;/span&gt;];&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;number = tokens[&lt;span class="s5"&gt;1&lt;/span&gt;];&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;width = tokens[&lt;span class="s5"&gt;2&lt;/span&gt;];&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;radius = tokens[&lt;span class="s5"&gt;3&lt;/span&gt;];&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;}&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s4"&gt;void&lt;/span&gt; &lt;span class="s6"&gt;RibBox&lt;/span&gt;::setRibBox()&lt;/p&gt; &lt;p class="p6"&gt;{&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;//formatacao dos comandos de saida para o stream &lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s7"&gt;cout&lt;/span&gt;&lt;span class="s3"&gt;&amp;lt;&amp;lt;&lt;/span&gt;"AttributeBegin\n"&lt;span class="s3"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s7"&gt;cout&lt;/span&gt;&lt;span class="s3"&gt;&amp;lt;&amp;lt;&lt;/span&gt;"Points \"P\" ["&lt;span class="s3"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s4"&gt;for&lt;/span&gt; (&lt;span class="s4"&gt;int&lt;/span&gt; i=&lt;span class="s5"&gt;0&lt;/span&gt;; i&amp;lt; (&lt;span class="s7"&gt;atoi&lt;/span&gt;(number.&lt;span class="s7"&gt;c_str&lt;/span&gt;())); i++) &lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;{&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;randomPoint&lt;span class="s3"&gt;(-&lt;/span&gt;&lt;span class="s5"&gt;1&lt;/span&gt;&lt;span class="s3"&gt;, &lt;/span&gt;&lt;span class="s5"&gt;1&lt;/span&gt;&lt;span class="s3"&gt;);&lt;/span&gt;&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;normalize&lt;span class="s3"&gt;();&lt;/span&gt;&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;scalePoint&lt;span class="s3"&gt;();&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s7"&gt;cout&lt;/span&gt;&amp;lt;&lt;scalepnt[&lt;span class="s5"&gt;0]&amp;lt;&amp;lt;&lt;span class="s2"&gt;" "&lt;/span&gt;&amp;lt;&lt;scalepnt[&lt;span class="s5"&gt;1]&amp;lt;&amp;lt;&lt;span class="s2"&gt;" "&lt;/span&gt;&amp;lt;&lt;scalepnt[&lt;span class="s5"&gt;2]&amp;lt;&amp;lt;&lt;span class="s2"&gt;"  "&lt;/span&gt;;&lt;/scalepnt[&lt;span&gt;&lt;/scalepnt[&lt;span&gt;&lt;/scalepnt[&lt;span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;}&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s7"&gt;cout&lt;/span&gt;&amp;lt;&amp;lt;&lt;span class="s2"&gt;"]\n"&lt;/span&gt;;&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s7"&gt;cout&lt;/span&gt;&lt;span class="s3"&gt;&amp;lt;&amp;lt;&lt;/span&gt;"\"width\" ["&lt;span class="s3"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s4"&gt;for&lt;/span&gt; (&lt;span class="s4"&gt;int&lt;/span&gt; i=&lt;span class="s5"&gt;0&lt;/span&gt;; i&amp;lt; (&lt;span class="s7"&gt;atoi&lt;/span&gt;(number.&lt;span class="s7"&gt;c_str&lt;/span&gt;())); i++) &lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;{&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s7"&gt;cout&lt;/span&gt;&amp;lt;&amp;lt;&lt;span class="s6"&gt;randWidth&lt;/span&gt;(width)&amp;lt;&amp;lt;&lt;span class="s2"&gt;"  "&lt;/span&gt;;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;}&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s7"&gt;cout&lt;/span&gt;&amp;lt;&amp;lt;&lt;span class="s2"&gt;"] \n"&lt;/span&gt;;&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s7"&gt;cout&lt;/span&gt;&lt;span class="s3"&gt;&amp;lt;&amp;lt;&lt;/span&gt;"\"Cs\" ["&lt;span class="s3"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s4"&gt;for&lt;/span&gt; (&lt;span class="s4"&gt;int&lt;/span&gt; i=&lt;span class="s5"&gt;0&lt;/span&gt;; i&amp;lt; (&lt;span class="s7"&gt;atoi&lt;/span&gt;(number.&lt;span class="s7"&gt;c_str&lt;/span&gt;())); i++) &lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;{&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s7"&gt;cout&lt;/span&gt;&lt;span class="s3"&gt;&amp;lt;&amp;lt;&lt;/span&gt;randWidth&lt;span class="s3"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="s3"&gt;)&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s2"&gt;" "&lt;/span&gt;&lt;span class="s3"&gt;&amp;lt;&amp;lt;&lt;/span&gt;randWidth&lt;span class="s3"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="s3"&gt;)&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s2"&gt;" "&lt;/span&gt;&lt;span class="s3"&gt;&amp;lt;&amp;lt;&lt;/span&gt;randWidth&lt;span class="s3"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="s3"&gt;)&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s2"&gt;"   "&lt;/span&gt;&lt;span class="s3"&gt; ;&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;}&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s7"&gt;cout&lt;/span&gt;&amp;lt;&amp;lt;&lt;span class="s2"&gt;"]\n"&lt;/span&gt;;&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s7"&gt;cout&lt;/span&gt;&lt;span class="s3"&gt;&amp;lt;&amp;lt;&lt;/span&gt;"AttributeEnd\n"&lt;span class="s3"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s7"&gt;cout&lt;/span&gt;&amp;lt;&amp;lt;&lt;span class="s2"&gt;"\377"&lt;/span&gt;&amp;lt;&lt;std::endl;&lt; p=""&gt; &lt;/std::endl;&lt;&gt;&lt;/p&gt;&lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;}&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s4"&gt;void&lt;/span&gt; &lt;span class="s6"&gt;RibBox&lt;/span&gt;::randomPoint(&lt;span class="s4"&gt;double&lt;/span&gt; rangeMin, &lt;span class="s4"&gt;double&lt;/span&gt; rangeMax )&lt;/p&gt; &lt;p class="p6"&gt;{&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;//cria um valor aleatorio entre rangeMin e rangeMax para o arrayPoint&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s4"&gt;double&lt;/span&gt; step = rangeMax - rangeMin ;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s4"&gt;for&lt;/span&gt; (&lt;span class="s4"&gt;int&lt;/span&gt; i=&lt;span class="s5"&gt;0&lt;/span&gt;; i&amp;lt;&lt;span class="s6"&gt;VECTOR_SIZE&lt;/span&gt;; i++) &lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;{      &lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;point[i] = (step * &lt;span class="s4"&gt;static_cast&lt;/span&gt; &amp;lt;&lt;span class="s4"&gt;double&lt;/span&gt;&amp;gt; (&lt;span class="s7"&gt;rand&lt;/span&gt; ()) / &lt;span class="s4"&gt;static_cast&lt;/span&gt; &amp;lt;&lt;span class="s4"&gt;double&lt;/span&gt;&amp;gt; (&lt;span class="s1"&gt;RAND_MAX&lt;/span&gt;) -&lt;span class="s5"&gt;1&lt;/span&gt;);&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;}&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;}&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s4"&gt;void&lt;/span&gt; &lt;span class="s6"&gt;RibBox&lt;/span&gt;::normalize()&lt;/p&gt; &lt;p class="p6"&gt;{&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s4"&gt;double&lt;/span&gt; mag = &lt;span class="s7"&gt;sqrt&lt;/span&gt;(point[&lt;span class="s5"&gt;0&lt;/span&gt;] * point[&lt;span class="s5"&gt;0&lt;/span&gt;] + point[&lt;span class="s5"&gt;1&lt;/span&gt;] * point[&lt;span class="s5"&gt;1&lt;/span&gt;] + point[&lt;span class="s5"&gt;2&lt;/span&gt;] * point[&lt;span class="s5"&gt;2&lt;/span&gt;]);&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s4"&gt;for&lt;/span&gt; (&lt;span class="s4"&gt;int&lt;/span&gt; i=&lt;span class="s5"&gt;0&lt;/span&gt;; i&amp;lt;&lt;span class="s6"&gt;VECTOR_SIZE&lt;/span&gt;; i++) &lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;{&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;normPoint[i] = point[i]/mag;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;}&lt;/p&gt; &lt;p class="p6"&gt;}&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s4"&gt;void&lt;/span&gt; &lt;span class="s6"&gt;RibBox&lt;/span&gt;::scalePoint()&lt;/p&gt; &lt;p class="p6"&gt;{&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s4"&gt;int&lt;/span&gt; radiusInt = &lt;span class="s7"&gt;atoi&lt;/span&gt;(radius.&lt;span class="s7"&gt;c_str&lt;/span&gt;());&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s4"&gt;for&lt;/span&gt; (&lt;span class="s4"&gt;int&lt;/span&gt; i=&lt;span class="s5"&gt;0&lt;/span&gt;; i&amp;lt;&lt;span class="s6"&gt;VECTOR_SIZE&lt;/span&gt;; i++) &lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;{&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;scalePnt[i] = normPoint[i] * radiusInt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;}&lt;/p&gt; &lt;p class="p6"&gt;}&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="s4"&gt;double&lt;/span&gt;&lt;span class="s3"&gt; &lt;/span&gt;RibBox&lt;span class="s3"&gt;::&lt;/span&gt;randWidth&lt;span class="s3"&gt;(std::&lt;/span&gt;&lt;span class="s7"&gt;string&lt;/span&gt;&lt;span class="s3"&gt; max)&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;{&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s4"&gt;double&lt;/span&gt; maxInt = &lt;span class="s7"&gt;atof&lt;/span&gt;(max.&lt;span class="s7"&gt;c_str&lt;/span&gt;());&lt;/p&gt; &lt;p class="p7"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;return&lt;span class="s3"&gt; (maxInt * &lt;/span&gt;static_cast&lt;span class="s3"&gt; &amp;lt;&lt;/span&gt;double&lt;span class="s3"&gt;&amp;gt; (&lt;/span&gt;&lt;span class="s7"&gt;rand&lt;/span&gt;&lt;span class="s3"&gt; ()) / &lt;/span&gt;static_cast&lt;span class="s3"&gt; &amp;lt;&lt;/span&gt;double&lt;span class="s3"&gt;&amp;gt; (&lt;/span&gt;&lt;span class="s1"&gt;RAND_MAX&lt;/span&gt;&lt;span class="s3"&gt;));&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;}&lt;/p&gt; &lt;p class="p2"&gt; e o main.cpp :&lt;/p&gt;&lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="p2"&gt;        &lt;/p&gt;&lt;p class="p1"&gt;&lt;span class="s1"&gt;#include &lt;/span&gt;&lt;iostream&gt;&lt;/iostream&gt;&lt;/p&gt; &lt;p class="p2"&gt;#include &lt;span class="s2"&gt;&lt;string&gt;&lt;/string&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;#include &lt;span class="s2"&gt;&lt;vector&gt;&lt;/vector&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;#include &lt;span class="s2"&gt;&lt;cmath&gt;&lt;/cmath&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s1"&gt;#include &lt;/span&gt;"RibBox.h"&lt;/p&gt; &lt;p class="p3"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p3"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="s3"&gt;int&lt;/span&gt; main (&lt;span class="s3"&gt;int&lt;/span&gt; argc, &lt;span class="s3"&gt;char&lt;/span&gt; * &lt;span class="s3"&gt;const&lt;/span&gt; argv[]) &lt;/p&gt; &lt;p class="p4"&gt;{&lt;/p&gt; &lt;p class="p3"&gt;    &lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s4"&gt;RibBox&lt;/span&gt; ribBoxObj;&lt;/p&gt; &lt;p class="p3"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p3"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="s5"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;while&lt;span class="s5"&gt;(&lt;/span&gt;&lt;span class="s6"&gt;1&lt;/span&gt;&lt;span class="s5"&gt;)&lt;/span&gt;&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;{&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;ribBoxObj.&lt;span class="s4"&gt;getRibBoxPar&lt;/span&gt;();&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;ribBoxObj.&lt;span class="s4"&gt;setRibBox&lt;/span&gt;();&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;}&lt;/p&gt; &lt;p class="p3"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p4"&gt;}&lt;/p&gt; &lt;p class="p3"&gt; e o comando de insercao no maya :&lt;/p&gt;&lt;p class="p3"&gt; &lt;/p&gt;&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"&gt;&lt;!--StartFragment--&gt;RiProcedural -pn "/Users/chrysl666/Desktop/devBook/classExerc02/build/Debug/classExerc02" -p "1000000 0.05 10" -b -1e38 1e38 -1e38 1e38 -1e38 1e38;&lt;!--EndFragment--&gt;&lt;/p&gt;&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-6032888048303044202?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/6032888048303044202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=6032888048303044202' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/6032888048303044202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/6032888048303044202'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2011/08/procedural-primitives-2.html' title='Procedural Primitives 2'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-PbwpOxPOZRE/Tl2eI4gbTWI/AAAAAAAAAFc/co-2ZhsNIbs/s72-c/RiProcedural_002_CHR_basicRenderPass.tif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-1310587337832939626</id><published>2011-08-29T12:54:00.000-07:00</published><updated>2011-08-29T13:43:19.601-07:00</updated><title type='text'>procedural primitives</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/-TKHTjrzy2IE/Tlv4ofKGy9I/AAAAAAAAAFU/PKbcyB7b_Es/s1600/RiProcedural_002_CHR_basicRenderPass_4.tif" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://1.bp.blogspot.com/-TKHTjrzy2IE/Tlv4ofKGy9I/AAAAAAAAAFU/PKbcyB7b_Es/s400/RiProcedural_002_CHR_basicRenderPass_4.tif" border="0" alt="" id="BLOGGER_PHOTO_ID_5646379932281392082" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;O Renderman tem formas simples para adicionar programas dentro do RIB sem ter que literalmente fazer plugin via DSO .. . basicamente voce chama um programa em qualquer&lt;/div&gt;&lt;div&gt;linguagem no meio do processo de render .. e o programa envia chamadas de API ou simples&lt;/div&gt;&lt;div&gt;comandos de RIB via stdout streams( no caso o stdout stream usado eh o prompt do sistema).&lt;/div&gt;&lt;div&gt;o Renderman entende essas chamadas como c elas tivessem vindo do maya ou do RIB.&lt;/div&gt;&lt;div&gt;Voce pode usar qualquer linguagem pra isso .. basta saber usar a saida e entrada padrao de stream da linguagem escolhida.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;existem muitos exemplos na internet de como fazer isso usando python , tcl  ou "C" ,&lt;/div&gt;&lt;div&gt;mas eu resolvi fazer isso usando um pouco de c++OOP approach : ) ; logico que isso deixa tudo um pouco mais complicado do realmente deveria .. ja que os muitos exemplos que vi em "C" sem OOP eram ridiculos de simples e faceis : ) .. mas como a intencao eh aprender a experiencia valeu : )....meu exemplo tbm eh simples .. fazer uma esfera  no meio da tela : ) usando chamadas ao meu programa  sem ter essa esfera na cena do maya .. bem segue os codigos&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;main:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;        &lt;p class="p1"&gt;&lt;span class="s1"&gt;#include &lt;/span&gt;iostream&lt;/p&gt; &lt;p class="p2"&gt;#include &lt;span class="s2"&gt;string&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;#include &lt;span class="s2"&gt;vector&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s1"&gt;#include &lt;/span&gt;algorithm&lt;/p&gt; &lt;p class="p3"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s1"&gt;#include &lt;/span&gt;"RibBox.h"&lt;/p&gt; &lt;p class="p3"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p3"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="s3"&gt;int&lt;/span&gt; main (&lt;span class="s3"&gt;int&lt;/span&gt; argc, &lt;span class="s3"&gt;char&lt;/span&gt; * &lt;span class="s3"&gt;const&lt;/span&gt; argv[]) &lt;/p&gt; &lt;p class="p4"&gt;{&lt;/p&gt; &lt;p class="p3"&gt;    &lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt; &lt;span class="s4"&gt;RibBox&lt;/span&gt; ribBoxObj;&lt;/p&gt; &lt;p class="p5"&gt;&lt;span class="s5"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;while&lt;span class="s5"&gt;(&lt;/span&gt;&lt;span class="s6"&gt;1&lt;/span&gt;&lt;span class="s5"&gt;)&lt;/span&gt;&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;{&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;ribBoxObj.&lt;span class="s4"&gt;getRibBoxPar&lt;/span&gt;();&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;ribBoxObj.&lt;span class="s4"&gt;setRibBox&lt;/span&gt;();&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;}&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p4"&gt;}&lt;/p&gt;&lt;p class="p4"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="p4"&gt;header:&lt;/p&gt;&lt;p class="p4"&gt;        &lt;/p&gt;&lt;p class="p1"&gt;/*&lt;/p&gt; &lt;p class="p1"&gt; *  RibBox.h&lt;/p&gt; &lt;p class="p1"&gt; *  classExerc&lt;/p&gt; &lt;p class="p1"&gt; *&lt;/p&gt; &lt;p class="p1"&gt; *  Created by chrysl666 on 8/27/11.&lt;/p&gt; &lt;p class="p1"&gt; *  Copyright 2011 none. All rights reserved.&lt;/p&gt; &lt;p class="p1"&gt; *&lt;/p&gt; &lt;p class="p1"&gt; */&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p3"&gt;#ifndef RIBBOX_H&lt;/p&gt; &lt;p class="p3"&gt;#define RIBBOX_H&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p3"&gt;#include &lt;span class="s1"&gt;&lt;vector&gt;&lt;/vector&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="p3"&gt;#include &lt;span class="s1"&gt;&lt;string&gt;&lt;/string&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="s2"&gt;class&lt;/span&gt; RibBox&lt;/p&gt; &lt;p class="p4"&gt;{&lt;/p&gt; &lt;p class="p5"&gt;public&lt;span class="s3"&gt;:&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;//constructor&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;RibBox();&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;//variaveis&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s4"&gt;string&lt;/span&gt; parFromMaya ; &lt;span class="s5"&gt;//sent by renderman&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s4"&gt;string&lt;/span&gt;&lt;span class="s3"&gt; details;    &lt;/span&gt;//  got from splited[0]&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s4"&gt;string&lt;/span&gt;&lt;span class="s3"&gt; scaleSize ;&lt;/span&gt;//   got from splited[1]&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;//funcoes&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class="s2"&gt;void&lt;/span&gt;&lt;span class="s3"&gt; setRibBox();&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// insert commands at render  stream&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class="s2"&gt;void&lt;/span&gt;&lt;span class="s3"&gt; getRibBoxPar();&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// get par from renderman&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s2"&gt;void&lt;/span&gt; Tokenize(&lt;span class="s2"&gt;const&lt;/span&gt; std::&lt;span class="s4"&gt;string&lt;/span&gt;&amp;amp; ,&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;  std::&lt;span class="s4"&gt;vector&lt;/span&gt;&lt;std::&lt;span class="s4"&gt;string&amp;gt;&amp;amp; ,&lt;/std::&lt;span&gt;&lt;/p&gt; &lt;p class="p4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;  &lt;span class="s2"&gt;const&lt;/span&gt; std::&lt;span class="s4"&gt;string&lt;/span&gt;&amp;amp; ); &lt;span class="s5"&gt;//tokenize&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p4"&gt;};&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p3"&gt;#endif&lt;/p&gt;&lt;p class="p3"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="p3"&gt;implementacao da classe:&lt;/p&gt;&lt;p class="p3"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="p3"&gt;        &lt;/p&gt;&lt;p class="p1"&gt;/*&lt;/p&gt; &lt;p class="p1"&gt; *  RibBox.cpp&lt;/p&gt; &lt;p class="p1"&gt; *  classExerc&lt;/p&gt; &lt;p class="p1"&gt; *&lt;/p&gt; &lt;p class="p1"&gt; *  Created by chrysl666 on 8/27/11.&lt;/p&gt; &lt;p class="p1"&gt; *  Copyright 2011 none. All rights reserved.&lt;/p&gt; &lt;p class="p1"&gt; *&lt;/p&gt; &lt;p class="p1"&gt; */&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="s1"&gt;#include &lt;/span&gt;&lt;iostream&gt;&lt;/iostream&gt;&lt;/p&gt; &lt;p class="p4"&gt;#include &lt;span class="s2"&gt;&lt;vector&gt;&lt;/vector&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="p4"&gt;#include &lt;span class="s2"&gt;&lt;string&gt;&lt;/string&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="s1"&gt;#include &lt;/span&gt;"RibBox.h"&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p5"&gt;RibBox&lt;span class="s3"&gt;::&lt;/span&gt;RibBox&lt;span class="s3"&gt;()&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;{&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;}&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// tokenize function // precisa ser implementado antes de ser usado&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s4"&gt;void&lt;/span&gt; &lt;span class="s5"&gt;RibBox&lt;/span&gt;::Tokenize(&lt;span class="s4"&gt;const&lt;/span&gt; std::&lt;span class="s6"&gt;string&lt;/span&gt;&amp;amp; str,&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;  std::&lt;span class="s6"&gt;vector&lt;/span&gt;&lt;std::&lt;span class="s6"&gt;string&amp;gt;&amp;amp; tokens,&lt;/std::&lt;span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;  &lt;span class="s4"&gt;const&lt;/span&gt; std::&lt;span class="s6"&gt;string&lt;/span&gt;&amp;amp; delimiters = &lt;span class="s2"&gt;" "&lt;/span&gt;)&lt;/p&gt; &lt;p class="p6"&gt;{&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// pula o delimitadores no inicio&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s6"&gt;string&lt;/span&gt;::&lt;span class="s6"&gt;size_type&lt;/span&gt; lastPos = str.&lt;span class="s6"&gt;find_first_not_of&lt;/span&gt;(delimiters, &lt;span class="s7"&gt;0&lt;/span&gt;);&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// acha o primeiro nao delimitador&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s6"&gt;string&lt;/span&gt;::&lt;span class="s6"&gt;size_type&lt;/span&gt; pos     = str.&lt;span class="s6"&gt;find_first_of&lt;/span&gt;(delimiters, lastPos);&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;    &lt;span class="s4"&gt;while&lt;/span&gt; (std::&lt;span class="s6"&gt;string&lt;/span&gt;::&lt;span class="s6"&gt;npos&lt;/span&gt; != pos || std::&lt;span class="s6"&gt;string&lt;/span&gt;::&lt;span class="s6"&gt;npos&lt;/span&gt; != lastPos)&lt;/p&gt; &lt;p class="p6"&gt;    {&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// achou um token , add no vetor.&lt;/p&gt; &lt;p class="p6"&gt;        tokens.&lt;span class="s6"&gt;push_back&lt;/span&gt;(str.&lt;span class="s6"&gt;substr&lt;/span&gt;(lastPos, pos - lastPos));&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// pula delimitadores.  Note o "nao_de"&lt;/p&gt; &lt;p class="p6"&gt;        lastPos = str.&lt;span class="s6"&gt;find_first_not_of&lt;/span&gt;(delimiters, pos);&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;// procura proximo "nao-delimitador"&lt;/p&gt; &lt;p class="p6"&gt;        pos = str.&lt;span class="s6"&gt;find_first_of&lt;/span&gt;(delimiters, lastPos);&lt;/p&gt; &lt;p class="p6"&gt;    }&lt;/p&gt; &lt;p class="p6"&gt;}&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s4"&gt;void&lt;/span&gt; &lt;span class="s5"&gt;RibBox&lt;/span&gt;::getRibBoxPar()&lt;/p&gt; &lt;p class="p6"&gt;{&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p1"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s6"&gt;vector&lt;/span&gt;&lt;span class="s3"&gt;&lt;std::&lt; span=""&gt;&lt;span class="s6"&gt;string&lt;/span&gt;&lt;span class="s3"&gt;&amp;gt; tokens; &lt;/span&gt;// um vector de string temporario&lt;/std::&lt;&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s6"&gt;getline&lt;/span&gt;(std::&lt;span class="s6"&gt;cin&lt;/span&gt;,parFromMaya);&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s5"&gt;Tokenize&lt;/span&gt;(parFromMaya ,tokens);&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;details = tokens[&lt;span class="s7"&gt;0&lt;/span&gt;];&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;scaleSize = tokens[&lt;span class="s7"&gt;1&lt;/span&gt;];&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;}&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="s4"&gt;void&lt;/span&gt; &lt;span class="s5"&gt;RibBox&lt;/span&gt;::setRibBox()&lt;/p&gt; &lt;p class="p6"&gt;{&lt;/p&gt; &lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s6"&gt;cout&lt;/span&gt;&lt;span class="s3"&gt;&amp;lt;&amp;lt;&lt;/span&gt;"AttributeBegin\n"&lt;span class="s3"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s6"&gt;cout&lt;/span&gt;&amp;lt;&amp;lt;&lt;span class="s2"&gt;"Scale "&lt;/span&gt;&amp;lt;&lt;scalesize&lt;&lt;&lt;span class="s2"&gt;" "&amp;lt;&lt;scalesize&lt;&lt;&lt;span class="s2"&gt;" "&amp;lt;&lt;scalesize&lt;&lt;&lt;span class="s2"&gt;"\n";&lt;/scalesize&lt;&lt;&lt;span&gt;&lt;/scalesize&lt;&lt;&lt;span&gt;&lt;/scalesize&lt;&lt;&lt;span&gt;&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s6"&gt;cout&lt;/span&gt;&lt;span class="s3"&gt;&amp;lt;&amp;lt; &lt;/span&gt;"Sphere [3 -3 3 360]\n"&lt;span class="s3"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p class="p3"&gt;&lt;span class="s3"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;/span&gt;&lt;span class="s6"&gt;cout&lt;/span&gt;&lt;span class="s3"&gt;&amp;lt;&amp;lt;&lt;/span&gt;"AttributeEnd\n"&lt;span class="s3"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;std::&lt;span class="s6"&gt;cout&lt;/span&gt;&amp;lt;&amp;lt;&lt;span class="s2"&gt;"\377"&lt;/span&gt;&amp;lt;&lt;std::endl;&lt; p=""&gt; &lt;/std::endl;&lt;&gt;&lt;/p&gt;&lt;p class="p2"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/p&gt; &lt;p class="p6"&gt;}&lt;/p&gt; &lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="p2"&gt;bem . depois de compilar  voce vai ter um programa chamado "classExerc"&lt;br /&gt;que recebe uma parametro float qualquer que representa o tamanho da esfera que voce quer criar. .. mas pro render chamar esse programa eh preciso definiar algumas coisas no maya&lt;br /&gt;&lt;/p&gt;&lt;p class="p2"&gt;no meu caso eu criei um box no {0,0,0} do grid do maya e adicionei alguns attributos&lt;br /&gt;do 3delight .. um Geometry , com a opcao OutPutGeometry desligado .. para esse cubo nao&lt;br /&gt;ser exportado para o render . esse cubo so serve como proxy para inserir os comando que eu preciso para chamar o programa ... o segundo atributo que eu inseri foi o Mel Script - PreGeoMel -- e adicionei o seguinte comando na caixa de dialogo &lt;/p&gt;&lt;p class="p2"&gt; &lt;/p&gt;&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"&gt;&lt;!--StartFragment--&gt;RiProcedural -pn "/Users/chrysl666/Desktop/devBook/classExerc/build/Debug/classExerc" -p "0.3" -b -1e38 1e38 -1e38 1e38 -1e38 1e38;&lt;!--EndFragment--&gt;&lt;/p&gt;&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"&gt;isso diz ao render " rode o programa procedural classExerc e envie o parametro 0.3 para o stream de saida  .. e reserve um espaco de bound de box de tamanho "1e38" para o objeto que o programa vai criar !&lt;/p&gt;&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"&gt; bem .. eh isso .. ao render voce vai ter uma sphere de tamanho 0.3 na tela . ao invez de um cubo.&lt;/p&gt;&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"&gt;bem .. sei que o exemplo como disse eh bem simples .. mas espero que tenha ajudado a entender como esse mecanismo funciona usando OOP ..  vou tentar criar alguns exemplos mais legais no proximo post : ) . &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="p2"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-1310587337832939626?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/1310587337832939626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=1310587337832939626' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/1310587337832939626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/1310587337832939626'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2011/08/procedural-primitives.html' title='procedural primitives'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-TKHTjrzy2IE/Tlv4ofKGy9I/AAAAAAAAAFU/PKbcyB7b_Es/s72-c/RiProcedural_002_CHR_basicRenderPass_4.tif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-3170930689167151885</id><published>2011-08-26T05:28:00.000-07:00</published><updated>2011-08-26T05:31:55.749-07:00</updated><title type='text'></title><content type='html'>&lt;a href="http://1.bp.blogspot.com/-e9xaB4Sj0oM/TleSGDmzcSI/AAAAAAAAAFM/S6kPnqE4a5E/s1600/icyCube_wip_1008.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 400px; height: 185px;" src="http://1.bp.blogspot.com/-e9xaB4Sj0oM/TleSGDmzcSI/AAAAAAAAAFM/S6kPnqE4a5E/s400/icyCube_wip_1008.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5645141290677137698" /&gt;&lt;/a&gt;&lt;br /&gt;Fiz um teste de raytracing  ( reflex e refrax )  para um trabalho . onde tinha que produzir alguns  blocos de gelo ... como no final o shader nao foi usado . resolvi postar o teste .. o shader eh  um simples archshader que ja vem com o 3delight .. bem util por sinal . um pouco lento porcausa dos samples .. quem sabe um dia eu tente programar um mais leve so pra essa finalidade de fazer gelo :P ... no momento ele me serviu bem .. pena que meu shader nao foi usado no final ..  mas valeu a experiencia : ) .. &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-3170930689167151885?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/3170930689167151885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=3170930689167151885' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/3170930689167151885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/3170930689167151885'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2011/08/fiz-um-teste-de-raytracing-reflex-e.html' title=''/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-e9xaB4Sj0oM/TleSGDmzcSI/AAAAAAAAAFM/S6kPnqE4a5E/s72-c/icyCube_wip_1008.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-8092626417841353903</id><published>2011-08-10T22:15:00.000-07:00</published><updated>2011-08-10T22:22:44.785-07:00</updated><title type='text'>3delight e photons</title><content type='html'>Andei testando um pouco os photons do 3delight .. mas nao gostei muito do processo .. mas acho que eh um problema  na minha copia de 3delight ( ou versao ) ... pelo que parece ela nao esta gerando o arquivo de photons pra reutilizacao como deveria . deixando meus renders muito lento pra uso de photons .. mas o engracado  eh que testes feitos numa versao de 3DL anterior funcionou muito bem ... bem .. segue a imagem de teste .. uma caverna feita com algumas caixas e mapas de displace . !&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/-4ZaqfarLgVo/TkNmhL8lIUI/AAAAAAAAAFE/D9OnweD2djQ/s1600/caverTest.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img src="http://3.bp.blogspot.com/-4ZaqfarLgVo/TkNmhL8lIUI/AAAAAAAAAFE/D9OnweD2djQ/s400/caverTest.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5639463878726590786" style="cursor: pointer; width: 400px; height: 225px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-8092626417841353903?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/8092626417841353903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=8092626417841353903' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/8092626417841353903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/8092626417841353903'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2011/08/3delight-e-photons.html' title='3delight e photons'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-4ZaqfarLgVo/TkNmhL8lIUI/AAAAAAAAAFE/D9OnweD2djQ/s72-c/caverTest.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-1355042951248558110</id><published>2009-09-06T17:02:00.001-07:00</published><updated>2009-09-06T17:07:31.469-07:00</updated><title type='text'>Pagina de Odio do Mental Ray ?</title><content type='html'>Durante uma pesquiza sobre algumas pessoas . eu achei uma pagina bem interessante .&lt;div&gt;um blog dedicado a mostrar as cagadas do Mental ray e porque ele eh uma bosta pra producao &lt;/div&gt;&lt;div&gt;de animation feature filmes  .. eu nao sou um antimental ray mas achei em interessante o topico .. muita das analises do cara  com certeza nunca ia fazer diferenca pra nois pobres mortais que usam mental ray pra pequena producao . mas pra quem tiver curiosidade .. segue ai o link &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://community.livejournal.com/antimentalray/"&gt;http://community.livejournal.com/antimentalray/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;ou &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://community.livejournal.com/antimentalray/331.html"&gt;http://community.livejournal.com/antimentalray/331.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;vale a pena olhar os outros Post no Blog : ) como o que ele fala doBejamin Butao :  ) ..&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;flw &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-1355042951248558110?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/1355042951248558110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=1355042951248558110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/1355042951248558110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/1355042951248558110'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2009/09/pagina-de-odio-do-mental-ray.html' title='Pagina de Odio do Mental Ray ?'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-2147715108619707371</id><published>2009-08-04T07:02:00.000-07:00</published><updated>2009-08-04T07:15:08.112-07:00</updated><title type='text'>3Delight !!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_q38IBDpuLUM/SnhAq6VksJI/AAAAAAAAACg/lHR8_CJOCCI/s1600-h/colorBleeding.png"&gt;&lt;img style="text-align: justify;float: left; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; cursor: pointer; width: 320px; height: 240px; " src="http://2.bp.blogspot.com/_q38IBDpuLUM/SnhAq6VksJI/AAAAAAAAACg/lHR8_CJOCCI/s400/colorBleeding.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5366110061970370706" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Depois de um longo inverno eu finalmente &lt;/div&gt;&lt;div&gt;voltei a mexer com renderman dessa vez usando&lt;/div&gt;&lt;div&gt;o 3delight para estudos ... apesar da diferenca de interface&lt;div&gt;entre ele  e o renderman for maya  ou o renderman studio .&lt;/div&gt;&lt;div&gt; estou conseguindo encontrar a maioria dos equivalentes &lt;/div&gt;&lt;div&gt;da interface do renderman   ...aqui vai um render teste usando&lt;/div&gt;&lt;div&gt;3delight . com shader de Occ + color Bleeding e sombras raytracing&lt;/div&gt;&lt;div&gt;.. o arquivo de teste foi retirado do pixar curseware e adaptado&lt;/div&gt;&lt;div&gt;para uso no 3delight ... &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-2147715108619707371?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/2147715108619707371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=2147715108619707371' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/2147715108619707371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/2147715108619707371'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2009/08/3delight.html' title='3Delight !!'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_q38IBDpuLUM/SnhAq6VksJI/AAAAAAAAACg/lHR8_CJOCCI/s72-c/colorBleeding.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-8735220895802381950</id><published>2007-07-10T04:42:00.000-07:00</published><updated>2007-07-10T05:02:28.245-07:00</updated><title type='text'>Raytracing e environment()</title><content type='html'>Usar a funcao gather() nao 'e a unica forma de conseguir uma reflexao&lt;br /&gt;com blur , no manual do renderman vem um exemplo muito legal de como&lt;br /&gt;usar o raytracing de outra forma , atraves da funcao environment().&lt;br /&gt;environment() costuma ser usado para adicionar uma reflexao atraves&lt;br /&gt;de um bitmap . mas o renderman aceita uma palavra reservada "raytracing"&lt;br /&gt;com essa funcao .. repassar uma palavra reservada&lt;br /&gt;para a funcao environment() forca o renderman a usar raytracing .&lt;br /&gt;&lt;br /&gt;environment() tbm tem opcoes de samples, dir , maxdist , e no lugar de&lt;br /&gt;angulo uma variacao para "blur" . nos meus testes environment() com raytracing&lt;br /&gt;deu resultados mais rapidos e com melhor qualidade com um menor&lt;br /&gt;numero de samples ..&lt;br /&gt;&lt;br /&gt;segue um shader de teste :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;/*----------------------------------------------------------------------------------------*/&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;surface envRayReflex ( &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;float Kr = 1; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;float samples = 1; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;float blur = 0 ; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;float maxdist = 1; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;)&lt;br /&gt;{&lt;br /&gt;color Crefl ; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;string envmap = "raytrace"; /* cria uma string para guardar a palavra reservada */&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if (N.I &lt;0)&lt;span style="font-size:85%;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;normal Nn = normalize(N);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;vector In = normalize(I);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;vector reflDir = reflect(In,Nn);&lt;br /&gt;Crefl = environment(envmap,reflDir,"samples",samples,"blur",blur,"maxdist",maxdist);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;} else { /* pintar de preto onde nao tiver nada para fazer raytracing */&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Crefl = 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;}&lt;br /&gt;Ci = Kr * Crefl;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Oi = 1; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*-----------------------------------------------------------------------------------------*/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;abaixo segue um exemplo com o mesmo setup do render anterior &lt;span style="font-size:85%;"&gt;(64SAMPLES, 0.18&lt;br /&gt;BLUR , MAXDIST 110)&lt;/span&gt;&lt;br /&gt;a qualidade do blur 'e bem melhor com um render mais rapido&lt;br /&gt;ainda nao sei exatamente porque fica tao mais rapido&lt;br /&gt;ja que por debaixo dos panos pelo que eu entendi . o renderman&lt;br /&gt;faz um gather() do mesmo modo .. bem ..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp0.blogger.com/_q38IBDpuLUM/RpNxkqMNA9I/AAAAAAAAAAs/pNuW9Uk5uBU/s1600-h/gatherReflexEnv.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5085533278846125010" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://bp0.blogger.com/_q38IBDpuLUM/RpNxkqMNA9I/AAAAAAAAAAs/pNuW9Uk5uBU/s400/gatherReflexEnv.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-8735220895802381950?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/8735220895802381950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=8735220895802381950' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/8735220895802381950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/8735220895802381950'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2007/07/raytracing-e-environment.html' title='Raytracing e environment()'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_q38IBDpuLUM/RpNxkqMNA9I/AAAAAAAAAAs/pNuW9Uk5uBU/s72-c/gatherReflexEnv.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-5228604092185513658</id><published>2007-07-10T04:14:00.000-07:00</published><updated>2007-07-10T04:29:23.000-07:00</updated><title type='text'>Raytracing e gather()</title><content type='html'>&lt;div&gt;A funcao gather()  produz um looping para capturar informacoes via raytracing , ele 'e usado para capturar informacoes do shader que o raio atinge a cada looping .. como ele tem uma emissao de multiplos raios em um certo angulo ele 'e ideal para produzir reflexoes com blur e outros truques com raytracing .&lt;br /&gt;&lt;br /&gt;a sintaxe da funcao gather:&lt;br /&gt;gather ( string category, point P, vector dir, float angle, float samples, ... ) {statements} [else {statements}]&lt;br /&gt;&lt;br /&gt;a funcao gather envia um cone de raios(samples) a partir do ponto P para a direcao "dir"em um determinado angulo "angle" . O angulo dado em radianos 'e medido a partir de "dir" .quanto maior o cone mais blur nos dados ou cores capturados , a qualidade desse blur 'e calculado pelo valor de samples . Quando um raio atinge uma surface ele captura informacoes diversas que podem ser escolhidas entre as variaveis globais do renderman ou uma informacao customizada do shader, a cada looping ele acumula as informacoes sobre as superficies. Uma media total das informacoes desses loopings 'e feita fora do looping , e adicionado no resultado final do seu shader , como voce pode ver existem dois blocos de statements , o primeiro blocovai ser executado quando o raio atingir uma surface e o codigo no bloco do "else" vai ser executado quando nao for atingida nenhuma superficie , o parametro "maxdist" limita os raios em uma certa distancia excluindo objetos fora desse campo .. muito bom para&lt;br /&gt;dar uma optimizada no desempenho do raytracing&lt;br /&gt;abaixo segue o codigo usando gather() :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;/*----------------------------------------------------------------------------------*/&lt;br /&gt;surface gatherReflex(&lt;br /&gt;float samples = 1;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;float coneAngulo = 0;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;float maxdist = 1&lt;br /&gt;)&lt;br /&gt;{&lt;br /&gt;/* inicia as variaveis para a cptura de informacoessbre a superficie e a cor do reflexo */&lt;br /&gt;color hitColor = 0;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;vector In = normalize(I);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;normal Nn = normalize(N);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;normal Nf = faceforward(Nn, In);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;float numhits = 0;&lt;br /&gt;Ci = 0;&lt;br /&gt;&lt;br /&gt;/* verifica o angulo da surface em relacao ao observador */&lt;br /&gt;if(Nn.-In &gt;= 0)&lt;br /&gt;{&lt;br /&gt;vector ReflexDir = reflect(In, Nn); /* acha a direcao do reflexo */&lt;br /&gt;&lt;br /&gt;/* inicia o gathering com as informacoes adquiridas , "surface:ci" vai ser a informacao capturado pelo raio ao bater em uma surface e adicionada na variavel hitcolor */&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;gather("illuminance", P, ReflexDir,coneAngulo,samples,"maxdist", maxdist, "surface:Ci",&lt;br /&gt;hitColor) &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;{ Ci += hitColor; /* adiciona a cor capturada em Ci */ &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;numhits += 1; /* conta o numero de raios que atingiram uma surface */&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;} else { hitColor = 0 ; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/* calcula a media das cores pelo raios atingidos assinalado em Ci */&lt;br /&gt;Ci /= numhits;&lt;br /&gt;Oi = 1;}&lt;br /&gt;/*-------------------------------------------------------------------------------------*/&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;um teste com samples 64 cone angle 0.18 e distancia 110&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp2.blogger.com/_q38IBDpuLUM/RpNr7KMNA8I/AAAAAAAAAAk/8aA18Ad1CH8/s1600-h/gatherReflex1.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5085527068323414978" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://bp2.blogger.com/_q38IBDpuLUM/RpNr7KMNA8I/AAAAAAAAAAk/8aA18Ad1CH8/s400/gatherReflex1.jpg" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-5228604092185513658?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/5228604092185513658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=5228604092185513658' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/5228604092185513658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/5228604092185513658'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2007/07/raytracing-e-gather.html' title='Raytracing e gather()'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_q38IBDpuLUM/RpNr7KMNA8I/AAAAAAAAAAk/8aA18Ad1CH8/s72-c/gatherReflex1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-1171259084189992440</id><published>2007-07-09T04:43:00.000-07:00</published><updated>2007-07-09T05:01:09.185-07:00</updated><title type='text'>trace() + etc..</title><content type='html'>segue um shader teste usando a trace() ambient() diffuse() specular()&lt;br /&gt;o shader ainda nao me parece tao legal e tbm nao sei c a soma final das funcoes&lt;br /&gt;esta feito do modo mais certo mas foi uma tentativa de juntar as funcoes&lt;br /&gt;&lt;br /&gt;ai vai o shader :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-size:85%;"&gt;surface mySurfReflex(&lt;br /&gt;float Kspecular = .5 ;&lt;br /&gt;float Kdifusse = .5 ;&lt;br /&gt;float Kambiente = 1 ;&lt;br /&gt;float Kroughness = .1;&lt;br /&gt;float KReflex = 1 ;&lt;br /&gt;color ambiente_color = 0 ;&lt;br /&gt;color diffuse_color = .8 ;&lt;br /&gt;color specular_color = .5 ;&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;/* cria variaveis para captura de informacoes sobre a superficie */&lt;br /&gt;normal Nf;&lt;br /&gt;vector V;&lt;br /&gt;Nf = faceforward( normalize(N), I );&lt;br /&gt;normal Nn = normalize(N);&lt;br /&gt;vector In = normalize(I);&lt;br /&gt;color Temp_reflex_color = 0 ;&lt;br /&gt;&lt;br /&gt;/* inicializa os calculos difuse ambiente e especular e acha a direcao e cor da reflexao */&lt;br /&gt;color Temp_ambiente_color = ambiente_color * Kambiente * ambient();&lt;br /&gt;color Temp_diffuse_color = diffuse_color * Kdifusse * diffuse(Nf);&lt;br /&gt;color Temp_specular_color = specular_color * Kspecular * specular(Nf,-In,Kroughness);&lt;br /&gt;&lt;br /&gt;/* verifica o angulo entre a superficie e o observador */&lt;br /&gt;if (Nn.-In &gt;= 0) {&lt;br /&gt;/* acha a direcao do reflexo entre a surface e o observador */&lt;br /&gt;vector DirecaoReflex = reflect(Nn,In);&lt;br /&gt;/*captura a cor do reflexo naquele ponto usando a funcao trace */&lt;br /&gt;Temp_reflex_color = KReflex * trace(P, DirecaoReflex);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* adiciona todas as informacoes achadas na cor final do shader*/&lt;br /&gt;Oi = Os;&lt;br /&gt;Ci = (Temp_ambiente_color + Temp_diffuse_color) + (Temp_specular_color + Temp_reflex_color);&lt;br /&gt;&lt;br /&gt;/* premultiplica a cor final com a opacidade */&lt;br /&gt;Ci *= Oi;&lt;br /&gt;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;e uma imagem do shader aplicado :&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp2.blogger.com/_q38IBDpuLUM/RpIgqaMNA7I/AAAAAAAAAAc/2ltZPiQrbPk/s1600-h/TraceReflex2.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5085162842211812274" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://bp2.blogger.com/_q38IBDpuLUM/RpIgqaMNA7I/AAAAAAAAAAc/2ltZPiQrbPk/s400/TraceReflex2.jpg" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-1171259084189992440?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/1171259084189992440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=1171259084189992440' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/1171259084189992440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/1171259084189992440'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2007/07/tempambientecolor-tempdiffusecolor.html' title='trace() + etc..'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_q38IBDpuLUM/RpIgqaMNA7I/AAAAAAAAAAc/2ltZPiQrbPk/s72-c/TraceReflex2.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-3021652710862890734</id><published>2007-07-09T01:46:00.000-07:00</published><updated>2007-07-09T01:56:48.894-07:00</updated><title type='text'>Raytracing e a funcao Trace</title><content type='html'>trace() segundo o manual do renderman :P envia um raio a partir de um ponto em uma determinada direcao,e retorna a cor da superficie em que o raio atingio, que 'e determinada pelo shader da superficie atingida&lt;br /&gt;uma coisa interessante da funcao shader 'e que quando voce assinala essa funcao dentro de uma variavel float ela vai retornar a distancia do ponto atingido ao inves da cor&lt;br /&gt;para a funcao trace funcionar no seu RFM ou RAT voce precisar ligar o "RAYTRACING" no seu render globals&lt;br /&gt;&lt;br /&gt;segue um exemplo de um shader com trace&lt;br /&gt;uma simples bola com reflexo aplicado :&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;surface TraceReflex( )  {&lt;br /&gt; /* captura as informacoes necessarias para o calculo da superficie */     &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;normal NormalSurface = normalize(N);      &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;vector Observador = normalize(I);      &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;color TempColorReflex = 0;&lt;br /&gt;     &lt;br /&gt; /* verifica o angulo entre  a superficie e o observador */ &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt; if (NormalSurface.Observador &lt; 0) {&lt;br /&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt; /* acha a direcao do reflexo entre a surface e o observador */&lt;br /&gt;       vector DirecaoReflex = reflect(NormalSurface,Observador);  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;/* captura a cor do reflexo naquele ponto usando a funcao trace */&lt;br /&gt;     TempColorReflex = trace(P, DirecaoReflex);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;      }&lt;br /&gt; /* assinala a cor capturada pela funcao trace na cor final do objeto */&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;      Ci = Os * TempColorReflex; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;      Oi = Os;&lt;br /&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;um exemplo do render :&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp0.blogger.com/_q38IBDpuLUM/RpH4IKMNA6I/AAAAAAAAAAU/0GVJFO-uSCY/s1600-h/TraceReflex.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_q38IBDpuLUM/RpH4IKMNA6I/AAAAAAAAAAU/0GVJFO-uSCY/s320/TraceReflex.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5085118273336181666" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-3021652710862890734?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/3021652710862890734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=3021652710862890734' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/3021652710862890734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/3021652710862890734'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2007/07/raytracing-e-funcao-trace.html' title='Raytracing e a funcao Trace'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_q38IBDpuLUM/RpH4IKMNA6I/AAAAAAAAAAU/0GVJFO-uSCY/s72-c/TraceReflex.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-113652039296752983</id><published>2006-01-05T20:00:00.000-08:00</published><updated>2011-08-24T04:26:40.583-07:00</updated><title type='text'>specular func</title><content type='html'>a funcao specular() retorna a contribuicao do brilho de uma surface. Para usar essa funcao vc tbm precisa informar algumas coisas sobre a geometria da cena . o specular precisa de uma Normal (N) com comprimento maximo de 1.0 e tbm um Vetor com comprimento de no maximo 1.0 definidos no ponto de vista do shader apontado pro observador, e tbm um valor que defina a Roughness da surface , Roughness ou rugosidade `e a medida que define as micro variacoes de altura em uma surface . olhando novamente na lista de variaveis e funcoes vc descobre que&lt;br /&gt;&lt;br /&gt;N = normal&lt;br /&gt;I = observador&lt;br /&gt;&lt;br /&gt;com essas informacoes vamos comecar a usar algumas funcoes que ja vimos para preparar as variaveis para o specular.&lt;br /&gt;Logo de cara um faceforward com um normalize para conseguir a normal com comprimento de no maximo 1 aprontada para o observador ..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;faceforward(normalize(N),I) ;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;agora vamos guardar isso em uma variavel para usar depois&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;normal Nf = faceforward(normalize(N),I) ;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;agora vamo descobrir o vetor em uma surface apontada para o observador com valor no maximo ate 1.0 .&lt;br /&gt;&lt;br /&gt;-normalize(I) ;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;essa funcao pegou o comprimento do vetor I que `e apontada pra surface . e inverteu colocando o sinal negativo na frente e com a funcao normalize convertemos ele pra um valor entre 0 e 1&lt;br /&gt;vamos guardar esse vetor em outra variavel para usar depois&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;vector V = -normalize(I);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;agora vamo criar um valor qualquer pro roughness&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;float roughness = 0.2 ;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;agora `e so adicionar isso na funcao specular&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;specular(Nf,V,roughness);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;pronto temos a funcao pronta pra usar . apenas somando o specular com o resto das contribuicoes ambiente&lt;br /&gt;e diffuse e assinale a Ci .&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;surface&lt;br /&gt;meushaderV2( color verde = (0.0 , 1.0 , 0.0 ) ; float roughness = 0.2 ; )&lt;br /&gt;{&lt;br /&gt;normal Nf = faceforward(normalize(N),I);&lt;br /&gt;vector V = -normalize(I) ;&lt;br /&gt;Oi = Os ;&lt;br /&gt;Ci = Os * verde *( ambient()+ diffuse(Nf)+ specular(Nf,V,roughness) );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;salve seu shader como meushaderV2.sl&lt;br /&gt;copile e teste !!&lt;br /&gt;um exemplo do shader no RFM&lt;br /&gt;&lt;br /&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger/736/2050/320/specular.jpg" border="0" /&gt;T+ e boa sorte !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-113652039296752983?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/113652039296752983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=113652039296752983' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/113652039296752983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/113652039296752983'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2006/01/specular.html' title='specular func'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-113641730752859927</id><published>2006-01-04T15:26:00.000-08:00</published><updated>2006-01-04T15:28:27.540-08:00</updated><title type='text'>Ambient() diffuse()</title><content type='html'>RSL tem algumas funcoes prontas que calculam a contribuicao da luz&lt;br /&gt;no shader . adicionando iluminacao ambient, diffuse e specular&lt;br /&gt;essas funcoes sao :&lt;br /&gt;&lt;br /&gt;ambient()&lt;br /&gt;diffuse()&lt;br /&gt;specular()&lt;br /&gt;&lt;br /&gt;algumas dessas funcoes precisam receber informacoes sobre a geometria para o calculo&lt;br /&gt;,a funcao ambient() é a mais simples em geral usada sem argumentos adicionais, mas&lt;br /&gt;ja a diffuse() precisa de uma normal com comprimento maximo de 1 apontada para a direcao contraria&lt;br /&gt;do Observador . confuso ne ! . eu tbm acho ! mas seguindo a relacao de funcoes e variaveis globais vc&lt;br /&gt;vai descobrir que N = normal de um objeto, I = vetor do observador, e que a funcao normalize(), converte&lt;br /&gt;o comprimento de um vetor em um valor entre 0 e 1 e finalmente a funcao faceforward() inverte a direcao&lt;br /&gt;da normal para aprontar na direcao contraria do observador no Ponto de vista do shader .&lt;br /&gt;entao no final fica assim&lt;br /&gt;&lt;br /&gt;faceforward(normalize(N),I) ;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;essa pequena funcao vai retornar um a normal do ponto a ser calculado com comprimento de no maximo 1 apontada para o observador&lt;br /&gt;vamos guardar isso em uma variavel do tipo normals .&lt;br /&gt;&lt;br /&gt;normal Nf = faceforward(normalize(N),I) ;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;bem agora que achamos a informacao que precisamos . é so adicionar isso como um argumento&lt;br /&gt;na funcao diffuse() .&lt;br /&gt;&lt;br /&gt;diffuse(Nf)&lt;br /&gt;&lt;br /&gt;aplicando tudo isso em um shader :&lt;br /&gt;&lt;br /&gt;surface&lt;br /&gt;meushader( color verde = (0.0 , 1.0 , 0.0 ) ; )&lt;br /&gt;{&lt;br /&gt;normal Nf = faceforward(normalize(N),I);&lt;br /&gt;Oi = Os ;&lt;br /&gt;Ci = Os * verde *(ambient()+ diffuse(Nf));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;copile e teste !!&lt;br /&gt;t+&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-113641730752859927?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/113641730752859927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=113641730752859927' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/113641730752859927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/113641730752859927'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2006/01/ambient-diffuse.html' title='Ambient() diffuse()'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-113640819655537686</id><published>2006-01-04T12:23:00.000-08:00</published><updated>2006-01-04T14:27:03.500-08:00</updated><title type='text'>Transparencia no MaisSimplesDoMundo.slo</title><content type='html'>como vc deve ter notado o shader maisSimplesDoMundo.slo apesar de ter um controle de opacidade ele nao funciona .. vamos modificar um pouco o shader para ligar a opacidade:&lt;br /&gt;&lt;br /&gt;surfaceMaisSimplesDoMundo( color vermelho = (1.0 , 0.0 , 0.0 ) ; )&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;Oi = Os ;&lt;br /&gt;Ci = Os*vermelho ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;eu adicionei novas variaveis no shader Oi e Os.&lt;br /&gt;Oi é a transparencia final do shader e Os é a transparencia default .. entao assinalei&lt;br /&gt;uma a outra ,para o controle ser centralizado , multipliquei isso pela cor , e liguei tudo a Ci&lt;br /&gt;. em geral a cor final é uma multiplicacao entre a cor e a transparencia .&lt;br /&gt;salve copile e teste .&lt;br /&gt;t+&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-113640819655537686?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/113640819655537686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=113640819655537686' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/113640819655537686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/113640819655537686'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2006/01/transparencia-no-maissimplesdomundoslo.html' title='Transparencia no MaisSimplesDoMundo.slo'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-113632948824471941</id><published>2006-01-03T14:59:00.000-08:00</published><updated>2006-01-03T15:04:48.256-08:00</updated><title type='text'>Usando custom Shaders  no RFM</title><content type='html'>O RFM vem com novo Node chamado RendermanShader , com ele vc pode&lt;br /&gt;utilizar shaders copilados pro renderman direto no maya, o unico problema&lt;br /&gt;desse node é que ele nao tem as conexoes de input e output, com isso&lt;br /&gt;conexoes entre shaders/nodes nao sao permitidas . a unica conexao permitida&lt;br /&gt;é via RendermanShaderSG. Nas propiedades desse shader existem somente as opcoes de&lt;br /&gt;Cor(Cs), Opacity (Os) , e um campo chamado "Shader" para adicionar o seu custom shader&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/736/2050/1600/RmanNode.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/736/2050/320/RmanNode.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;clike sobre a pastinha ao lado do campo Shader e carregue o shader copilado MaisSimplesDoMundo.slo.&lt;br /&gt;Apos carregar nosso shader MaisSimplesDoMundo.slo a interface do RenderManShader&lt;br /&gt;ganha uma nova propiedade "vermelho(Ci)"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/736/2050/1600/RmanMaisSimples.0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/736/2050/320/RmanMaisSimples.0.jpg" alt="" border="0" /&gt;&lt;/a&gt;....................&lt;br /&gt;t+&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-113632948824471941?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/113632948824471941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=113632948824471941' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/113632948824471941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/113632948824471941'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2006/01/usando-custom-shaders-no-rfm.html' title='Usando custom Shaders  no RFM'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-113631326127747188</id><published>2006-01-03T10:10:00.000-08:00</published><updated>2006-01-03T10:35:30.043-08:00</updated><title type='text'>copilando o Shader MaisSimplesDoMundo.sl</title><content type='html'>depois de ver um exemplo do Shader MaisSimplesDoMundo .. vamos copilar esse shader e carregar no RFM .. antes de tudo pra isso funcionar vc precisa ter uma Copia de algum renderman compativel . aqui nois vamos usar o RFM .&lt;br /&gt;Primeiro digite no Notepad o shader MaisSimplesDoMundo e salve em uma pasta de sua preferencia, com o nome MaisSimplesDoMundo.sl , no meu caso eu salvei o meu shader na pasta&lt;br /&gt;c:\temp&lt;br /&gt;&lt;br /&gt;agora usando a barra de start do windows . execute a opcao RUN ( executar) e digite no campo&lt;br /&gt;da ferramenta&lt;br /&gt;&lt;br /&gt;CMD&lt;br /&gt;&lt;br /&gt;isso vai abrir a janela do DOS&lt;br /&gt;&lt;br /&gt;entre na pasta onde vc salvou o shader&lt;br /&gt;cd c:\temp&lt;br /&gt;&lt;br /&gt;antes de copilar os shader é preciso configurar as variaveis de ambiente do RFM para ele poder achar os programas necessarios a compilacao&lt;br /&gt;&lt;br /&gt;digite no DOS :&lt;br /&gt;set RMANTREE=C:\Program Files\Pixar\RenderManForMaya7.0-1.0\rmantree&lt;br /&gt;&lt;br /&gt;e c sua versao de windows for em portugues é possivel que o path seja diferente :&lt;br /&gt;&lt;br /&gt;set RMANTREE=C:\arquivos de programas\Pixar\RenderManForMaya7.0-1.0\rmantree&lt;br /&gt;&lt;br /&gt;agora precisamos informar ao windows onde c encontra o copilador "shader.exe", em geral esse programa c instala na pasta /bin da instalacao do RFM&lt;br /&gt;&lt;br /&gt;digite o comando no DOS :&lt;br /&gt;&lt;br /&gt;set PATH = c:\Program Files\Pixar\RenderManForMaya7.0-1.0\bin&lt;br /&gt;&lt;br /&gt;c o seu windows for em portugues :&lt;br /&gt;&lt;br /&gt;set PATH=C:\arquivos de programas\Pixar\RenderManForMaya7.0-1.0\bin&lt;br /&gt;&lt;br /&gt;pronto apos configurar o RFM podemos copilar nosso shader&lt;br /&gt;digite no DOS :&lt;br /&gt;&lt;br /&gt;shader MaisSimplesDoMundo.sl&lt;br /&gt;&lt;br /&gt;c tudo for certo vc vai receber uma resposta como essa :&lt;br /&gt;&lt;br /&gt;MaisSimplesDoMundo: compiled.&lt;br /&gt;&lt;br /&gt;e um novo arquivo apareceu na sua pasta temp :&lt;br /&gt;&lt;br /&gt;MaisSimplesDoMundo.slo&lt;br /&gt;&lt;br /&gt;o formato .slo é o shader copilado . pronto para ser usado dentro do RFM&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-113631326127747188?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/113631326127747188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=113631326127747188' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/113631326127747188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/113631326127747188'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2006/01/copilando-o-shader-maissimplesdomundos.html' title='copilando o Shader MaisSimplesDoMundo.sl'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-113626714536127531</id><published>2006-01-02T21:25:00.000-08:00</published><updated>2007-07-09T02:00:35.109-07:00</updated><title type='text'>crie o seu primeiro shader para Renderman ( uma visao geral sobre RSL)</title><content type='html'>RSL `e uma linguagem similar ao C++ , o que isso quer dizer !?! tenho que aprender C++ ?? bem c vc nao tem nenhum conhecimento basico sobre programacao . seria bom comecar a aprender,tudo bem nao precisa ficar com medo , eu tbm nao sou programador , mas o basico de programacao `e bem facil de aprender e vai ajudar muito nao so com RSL mas tbm com MEL(maya scritp),outra coisa boa`e vc ter um conhecimento basico de 3d na parte de Render e Shader do seu programa favorito, muitas das palavras que usamos em um shader feito RSL tem seu equivalente na interface do seu programa.&lt;br /&gt;Bem pra comecar `e preciso entender a anatomia do shader no ponto de vista do renderman:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger/736/2050/320/AnatomiaDoShader.jpg" border="0" /&gt;&lt;/p&gt;&lt;p&gt;O Renderman pinta os objetos dando pequenas pinceladas de cor ponto a ponto sobre o objeto . para isso ele precisa de informacoes sobre a geometria , luz , e o ponto de observacao da camera e etc . essas informacoes sao predefinidas no renderman , sao as chamadas Variaveis Globais do Renderman&lt;br /&gt;&lt;br /&gt;Abaixo uma pequena (micro) lista de algumas variaveis :&lt;br /&gt;&lt;br /&gt;Os surface Opacity = transparencia original da surface&lt;br /&gt;Cs Surface Color = cor original da surface&lt;br /&gt;Oi Surface Opacity Incident = a transparencia da surface em direcao a camera&lt;br /&gt;Ci Surface Color Incident = a cor da surface em direcao a camera&lt;br /&gt;P Surface Position = um ponto qualquer na surface&lt;br /&gt;N Shading Normal = direcao da Normal de uma surface&lt;br /&gt;I Incident Vector = direcao do observador&lt;br /&gt;E Vantage (eye)point = a posicao do observador&lt;br /&gt;L Light Vector = direcao da Luz&lt;br /&gt;&lt;br /&gt;Antes de sair programando `e preciso falar sobre as variaveis " Os,Cs,Oi,Ci ", o renderman considera que a surface tem uma cor default e uma opacidade default, essas cores originais em geral sao variaveis que sao definidas dentro do corpo do arquivo .RIB .&lt;br /&gt;A Cor incidente e a Opacidade Incidente sao as cores e a transparencia final do objeto , resumindo , o renderman sempre vai colorir e definir a transparencia do seu objeto pela cor que vc definir na variavel Ci e Oi , mesmo que Cs e Os sejam cores diferentes.&lt;br /&gt;&lt;br /&gt;Abaixo o shader de renderman MaisSimplesDoMundo :&lt;br /&gt;&lt;br /&gt;surface&lt;br /&gt;MaisSimplesDoMundo( color vermelho = (1.0 , 0.0 , 0.0 ) ; )&lt;br /&gt;{&lt;br /&gt;Ci = vermelho ;&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Render feito no Maya usando&lt;br /&gt;o Shader MaisSimplesDoMundo:&lt;/p&gt;&lt;p&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger/736/2050/200/Simples01.1.jpg" border="0" /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-113626714536127531?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/113626714536127531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=113626714536127531' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/113626714536127531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/113626714536127531'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2006/01/rsl-uma-visao-geral.html' title='crie o seu primeiro shader para Renderman ( uma visao geral sobre RSL)'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20458951.post-113626424553846973</id><published>2006-01-02T20:53:00.000-08:00</published><updated>2006-01-02T21:05:41.856-08:00</updated><title type='text'>RAT ?!! RFM ??RIB ??RSL ??</title><content type='html'>o que sao esses nomes? . essas siglas costumam confundir um pouco quem esta comecando a entrar no mundo do renderman( tipo eu ) mas vou tentar explicar de uma forma simples&lt;br /&gt;&lt;br /&gt;o RenderMan ProServer `e um renderizador da pixar que trabalha com arquivos .Rib e shaders feitos na linguagem RSL.&lt;br /&gt;&lt;br /&gt;o Arquivo .Rib (rendermanBitStream) `e um tipo de arquivo ASCII que descreve cenas produzidas em um programade animacao ou  modelagem ,e o RSL (rendermanShadingLanguage) `e uma linguagem similar ao C++ que descreve os Shaders de cada objeto nos arquivos RIB.&lt;br /&gt;&lt;br /&gt;renderizar um arquivo Rib e utilizar RSL nao `e restrito apenas para quem `e dono de uma licensa de Renderman Pro Server , a Pixar a muitos anos atras durante o desenvolvimento desse tipo de arquivoe linguagem , resolveu liberar essas definicoes para outros desenvolvedores . com isso existem no mercado outros tipos de produtos de render que utilizam RIB e RSL , portanto para vc aprender nao `e necessario ter um Renderman . pode ser qualquer Renderizador RenderMan Compativel ;&lt;br /&gt;&lt;br /&gt;abaixo alguns renderizadores compativeis com RIb e RSL :&lt;br /&gt;&lt;br /&gt;Air&lt;br /&gt;Aqsis&lt;br /&gt;&lt;br /&gt;o RAT !!(RenderMan Artist Tool) :&lt;br /&gt;como o Renderman `e render muito flexivel gracas ao RIB e ao RSL , existem muitas formas de trabalhar com ele, muitos grandes estudios desenvolveram ferramentas que conectam seus softwares de 3d no renderman, mas para aumentar a velocidade de uso, a Pixar desenvolveu suas propias ferramentas de conexao entre o software 3d (MAYA) e o renderman. o pacote RAT `e exatamente isso . o renderizador Renderman + plugin de conexao com o maya + o editor de shaders + gerenciador de render + visualizador de imagens .&lt;br /&gt;nomeados pela Pixar como:&lt;br /&gt;MTOR = plugin de conexao&lt;br /&gt;SLIM = editor de shaders&lt;br /&gt;ALFRED = gerenciador de render em rede&lt;br /&gt;It = visualizador de imagens&lt;br /&gt;&lt;br /&gt;esse `e o pacote mais completo da Pixar pra quem quer ir fundo na utilizacao do renderman , cada pequena ferramenta dessa tem um mundo de comandos e opcoes ,sem falar do propio renderman e seus amigos RIB e RSL .&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;O RFM ( Renderman For Maya ) :&lt;br /&gt;Depois de muitos users low end reclamarem da falta de facilidade em usar o renderman em producoes menores , a Pixar resolveu produzir uma versao do renderman que fosse mais integrado e de facil utilizacao, com isso criaram o RenderMan For maya. Existem algumas diferencas entre os dois produtos , a primeira `e a falta de suporte ao arquivo .RIB , o renderman for maya nao pode criar ou abrir .Rib , a segunda `e que para utilizar shaders no renderman For maya vc nao precisa saber programar em RSL ou usar o editor Slim do RAT , A PIXAR integrou os shaders do Maya para o propio renderman , com isso a maioria dos shaders ,luzes ,etc  funciona transparente dentro do RFM . mas como a integracao ainda nao `e total  , a Pixar permitiu  usar shaders feitos para o RAT dentro do RFM, mas nao permitiu conexoes de shaders maya com Shaders renderman de forma direta (infelizmente) , mas com isso abriu a porta para um mundo novo de criacao de shaders usando a linguagem RSL .&lt;br /&gt;&lt;br /&gt;por Hoje `e so pessoal !!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20458951-113626424553846973?l=rman4all.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rman4all.blogspot.com/feeds/113626424553846973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20458951&amp;postID=113626424553846973' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/113626424553846973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20458951/posts/default/113626424553846973'/><link rel='alternate' type='text/html' href='http://rman4all.blogspot.com/2006/01/rat-rfm-rib-rsl.html' title='RAT ?!! RFM ??RIB ??RSL ??'/><author><name>chrysl666</name><uri>http://www.blogger.com/profile/00827887373165309108</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://1.bp.blogspot.com/_q38IBDpuLUM/SqjIBuu8QrI/AAAAAAAAACs/7rondyMQRyg/S220/sketchbookFile_04_CHR1.jpg'/></author><thr:total>0</thr:total></entry></feed>
