<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Digital Effects &#187; Cave flood</title>
	<atom:link href="http://www.xmg.ro/category/projects/research/cave-flood/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xmg.ro</link>
	<description>Felician Lepadatu - Production Blog</description>
	<lastBuildDate>Tue, 20 Sep 2011 17:08:06 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Felician Lepadatu &#124; RESEARCH &#124; Cave Flooding</title>
		<link>http://www.xmg.ro/cave-flooding-research/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=cave-flooding-research</link>
		<comments>http://www.xmg.ro/cave-flooding-research/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 10:45:00 +0000</pubDate>
		<dc:creator>Felician Lepadatu</dc:creator>
				<category><![CDATA[2010]]></category>
		<category><![CDATA[Cave flood]]></category>
		<category><![CDATA[Fluid Simulation]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Felician Lepadatu]]></category>
		<category><![CDATA[Felix]]></category>
		<category><![CDATA[krakatoa]]></category>
		<category><![CDATA[Real Flow]]></category>
		<category><![CDATA[RnD]]></category>
		<category><![CDATA[XMG production blog]]></category>

		<guid isPermaLink="false">http://localhost/xmg/?p=108</guid>
		<description><![CDATA[Latest Result:

To do list:

import/export mesh settings, scale, units, file formats, optimizations for complex geometry
simulation techniques, partitions, network sim, switches
solid dynamics inside fluid and interaction
fluid mesh building and export options
optimize mesh or surface building
shading
details: bump, ripples, foam, wet map, density map + shading
render passes + light setup
comp + nuke gizmos


01. import/export mesh settings, scale, units, file [...]]]></description>
			<content:encoded><![CDATA[<h2>Latest Result:</h2>
<div class="vimeoVideo"><object
		width="550" 
		height="309" 
		data="http://vimeo.com/moogaloop.swf?clip_id=8991319&amp;server=vimeo.com"
		type="application/x-shockwave-flash">
			<param name="allowfullscreen" value="true" />
			<param name="allowscriptaccess" value="always" />
			<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=8991319&amp;server=vimeo.com" />
		</object></div>
<ul></ul>
<h2>To do list:</h2>
<ul>
<li>import/export mesh settings, scale, units, file formats, optimizations for complex geometry</li>
<li>simulation techniques, partitions, network sim, switches</li>
<li>solid dynamics inside fluid and interaction</li>
<li>fluid mesh building and export options</li>
<li>optimize mesh or surface building</li>
<li>shading</li>
<li>details: bump, ripples, foam, wet map, density map + shading</li>
<li>render passes + light setup</li>
<li>comp + nuke gizmos</li>
</ul>
<p><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0 } --></p>
<h2>01. import/export mesh settings, scale, units, file formats, optimizations for complex geometry</h2>
<p>3D Studio Max units scale 1 unit = 1 meter<br />
import scale in RealFlow 1<br />
scene size for simulation grid inside 3DSMax aprox. 30 meters X 30 meters<br />
the geometry container can be single sided but the normals have to be toward the fluid<br />
the geometry container has to be collapsed to poly, triangle faces, max 7K triangles (we choose this value arbitrary and it seems to work both ways &#8211; quality and size wise/speed), pivot centered on 0,0,0 world, pivot aligned to world. this is initial state for geometry in order to reference everything by this.<br />
the object can be exported as OBJ or SD from inside 3DSMax. I exporting SD, single frame, selected object.<br />
the object can be imported back from RealFlow as SD or OBJ. The SD import works great and does not affect pivot or scene placement. The condition is not to have the same named object inside 3DSMax.<br />
the SD export object can be activated under Export Central inside RealFlow.<br />
if the export option is OBJ, then you have to mirror it on Y axes with the offset -2*Y_value (keep in mind initial state mesh).<br />
RealFlow fluid meshes export as bin&#8217;s and it come as &#8216;flipped&#8217; inside 3DSMax.<br />
scale -Y and it snaps into place.</p>
<p><strong>Mesh optimization results:</strong></p>
<p>Updated low resolution cave mesh (for fluid simulation). Decimated from 40k to only 4k faces.</p>
<p>Shape curvature deviation is kept between 4% and 16%. Planar surfaces were decimated separately to keep the poly count to a minimum.</p>
<p>Dark green areas show original dense topology. Brighter colors show low res version.</p>
<a rel="lightbox" title="Flood cave - optimize meshl" href=http://www.xmg.ro/wp-content/uploads/2010/01/cave_SIM01Snap00.jpg><img src=http://www.xmg.ro/wp-content/uploads/2010/01/cave_SIM01Snap00.jpg class="lightboximage size-thumbnail wp-image-134" src=http://www.xmg.ro/wp-content/uploads/2010/01/cave_SIM01Snap00.jpg title="Flood cave - optimize meshl" alt="Flood cave - optimize meshl" width=550 height=309 /> </a>
<p>Triangle spread and topology.</p>
<a rel="lightbox" title="Flood cave - optimize meshl" href=http://www.xmg.ro/wp-content/uploads/2010/01/cave_SIM01Snap01.jpg><img src=http://www.xmg.ro/wp-content/uploads/2010/01/cave_SIM01Snap01.jpg class="lightboximage size-thumbnail wp-image-134" src=http://www.xmg.ro/wp-content/uploads/2010/01/cave_SIM01Snap01.jpg title="Flood cave - optimize meshl" alt="Flood cave - optimize meshl" width=550 height=309 /> </a>
<h2>02. initial settings for fluid, density, viscosity, no of particles</h2>
<p>1. Scale 1 unit = 1 meter (3dsmax), scale 1.00 (realFlow)<br />
2. Realflow Sim FPS 25fps<br />
<em>Current Settings</em></p>
<ul>
<li>Resolution 0.1 =&gt; 300k particles to fill the whole volume</li>
<li>Density 1000</li>
<li>int pressure 1</li>
<li>ext pressure 1</li>
<li>Viscosity 3</li>
<li>Surface Tension 0</li>
<li>Max Particles 5000k</li>
</ul>
<p>Conclusion: &#8211; to be simulated<br />
Last sim looked good but particles were too scarse so mesh ended up with low definition.</p>
<p><em>Production Settings</em></p>
<ul>
<li>Resolution (all fluids) 1 =&gt; 1400k particles to fill the whole volume</li>
<li>Max particles count (all fluids) =&gt; 5000k</li>
<li>Water density = 1000</li>
<li>ReWater density = 1000</li>
<li>Foam density = 780</li>
<li>Spray density = 700</li>
<li>Scene scale = 1</li>
<li>Sim time for 600 frames = aprox. 52h</li>
</ul>
<h2>03. simulation techniques, partitions, network sim, switches</h2>
<p>The particle emiters are:</p>
<ul>
<li>Water &#8211; density 1000</li>
<li>ReWater &#8211; density 1000</li>
<li>Foam &#8211; density 780</li>
<li>Spray &#8211; density 700</li>
</ul>
<p>The script has been tested on a 1.0 RF scale</p>
<p>Event script: <em>waveFoamSprayEvent</em> v1.0 from <strong>nextlimit</strong> website &#8211; all the copyright to the owner.</p>
<p>What the event script does:</p>
<ol>
<li>cycles trough every <em>water</em> particles and tests for pressure, velocity and collision.</li>
<li>when the <em>water </em>particles values tested are inside the treshold limits stated by us, we copy the particle from the<em> water </em>emitter to the <em>foam</em> emitter.</li>
<li>cycles trough every <em>foam</em> particles and tests for age and height,</li>
<li>when the <em>foam</em> particles values tested are inside the treshold limits stated by us, we copy the particle from the <em>foam</em> emitter to the <em>rewater</em> emitter.</li>
</ol>
<p>We modified the script to get the <em>ReWater</em> particles back to <em>Water</em> particles after given time, in order to end up with only one fluid. This is because we want to pass only one particle system to the next stage.</p>
<p><code># Transform particles back to REwater back to WATER</code></p>
<p><code> </code></p>
<p><code>particle_rewater = rewater.getFirstParticle()</code></p>
<p><code> </code></p>
<p><code>while (particle_rewater):</code></p>
<p><code>current_age = particle_rewater.getAge()</code></p>
<p><code>vel_rewater = particle_rewater.getVelocity()</code></p>
<p><code>pos_rewater = particle_rewater.getPosition()</code></p>
<p><code>if (current_age &gt;= 2):</code></p>
<p><code>water.addParticle(pos_rewater,vel_rewater)</code></p>
<p><code>rewater.removeParticle(particle_rewater.getId())</code></p>
<p><code> </code></p>
<p><code>particle_foam = particle_foam.getNextParticle()</code></p>
<p><span> </span><span> </span></p>
<p><strong>Final result of the simulation:</strong></p>
<div class="vimeoVideo"><object
		width="550" 
		height="309" 
		data="http://vimeo.com/moogaloop.swf?clip_id=8818146&amp;server=vimeo.com"
		type="application/x-shockwave-flash">
			<param name="allowfullscreen" value="true" />
			<param name="allowscriptaccess" value="always" />
			<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=8818146&amp;server=vimeo.com" />
		</object></div>
<h2 style="font-size: 1.5em;">04. solid dynamics inside fluid and interaction</h2>
<p>- on hold for the time being</p>
<h2 style="font-size: 1.5em;">05. fluid mesh building and export options</h2>
<p>First pass: one mesh (Water + ReWater)</p>
<ul>
<li>polygon size 0.06</li>
<li>filters on</li>
<li>relaxation 0.1</li>
<li>tension 0.05</li>
<li>steps 64</li>
<li>radius 0.04</li>
</ul>
<p>Export mesh as .bin file</p>
<p><strong>Final result of the mesh build &#8211; rendered on mray</strong></p>
<div class="vimeoVideo"><object
		width="550" 
		height="309" 
		data="http://vimeo.com/moogaloop.swf?clip_id=8991316&amp;server=vimeo.com"
		type="application/x-shockwave-flash">
			<param name="allowfullscreen" value="true" />
			<param name="allowscriptaccess" value="always" />
			<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=8991316&amp;server=vimeo.com" />
		</object></div>
<h2 style="font-size: 1.5em;">06. shading</h2>
<h3>Foam shading &#8211; pyrocluster and mental ray:</h3>
<p>Use Real Flow particle cache .bin files inside 3dsmax. For shading particles I choose pyrocluster voxel renderer because of the integration with the mental ray:</p>
<p>3D Studio Max scale values: 1 unit = 1 meter, display metric</p>
<p>Pyrocluster settings for foam:</p>
<ul>
<li>include RFparticles_foam &#8211; particle system</li>
<li>include 1 spot light with shadow cast on &#8211; same position as the sunlight in the scene</li>
<li>initial step 0.1m</li>
<li>color 1 = 240,248,254</li>
<li>color 2 = 213,221,225</li>
<li>illumination enable</li>
<li>receive shadow on</li>
<li>self shadows on</li>
<li>initial shadow step = 0.2m</li>
<li>override light settings on</li>
<li>shadow type = raytrace shadows</li>
<li>shape = sphere</li>
<li>radius 0.2m</li>
<li>squash 0.1</li>
<li>regularity 30%</li>
<li>velocity scale on</li>
<li>stretch 5.0</li>
<li>noise type = turbulence</li>
<li>density 260</li>
<li>size 0.2</li>
<li>details 3</li>
</ul>
<p><strong>first render of the foam particles &#8211; no upscale interpolation</strong></p>
<div class="vimeoVideo"><object
		width="550" 
		height="309" 
		data="http://vimeo.com/moogaloop.swf?clip_id=8991315&amp;server=vimeo.com"
		type="application/x-shockwave-flash">
			<param name="allowfullscreen" value="true" />
			<param name="allowscriptaccess" value="always" />
			<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=8991315&amp;server=vimeo.com" />
		</object></div>
<p><strong>clay mesh + foam particles geometry + pyrocluster</strong></p>
<div class="vimeoVideo"><object
		width="550" 
		height="309" 
		data="http://vimeo.com/moogaloop.swf?clip_id=8991319&amp;server=vimeo.com"
		type="application/x-shockwave-flash">
			<param name="allowfullscreen" value="true" />
			<param name="allowscriptaccess" value="always" />
			<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=8991319&amp;server=vimeo.com" />
		</object></div>
]]></content:encoded>
			<wfw:commentRss>http://www.xmg.ro/cave-flooding-research/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

