<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - X-Ray, Z-order, draw 3d objects order]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=852</link>
		<description><![CDATA[The most recent posts in X-Ray, Z-order, draw 3d objects order.]]></description>
		<lastBuildDate>Wed, 23 Oct 2013 20:24:57 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: X-Ray, Z-order, draw 3d objects order]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5758#p5758</link>
			<description><![CDATA[<p>yes sorry, you are right, because MGame::draw(); call a clear.</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Wed, 23 Oct 2013 20:24:57 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5758#p5758</guid>
		</item>
		<item>
			<title><![CDATA[Re: X-Ray, Z-order, draw 3d objects order]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5755#p5755</link>
			<description><![CDATA[<p>Yeah, it works; we were overcomplicating things eheh.<br />BTW doing<br /></p><div class="codebox"><pre><code>MGame::draw();</code></pre></div><p>seems to erase the first draw (so you see only the x-ray object).<br />So the correct way to go is<br /></p><div class="codebox"><pre><code>engine-&gt;getRenderer()-&gt;drawScene(scene,camera);</code></pre></div><p>or<br /></p><div class="codebox"><pre><code>scene-&gt;draw(camera);</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (255)]]></author>
			<pubDate>Wed, 23 Oct 2013 19:33:27 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5755#p5755</guid>
		</item>
		<item>
			<title><![CDATA[Re: X-Ray, Z-order, draw 3d objects order]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5751#p5751</link>
			<description><![CDATA[<p>Ahah that&#039;s smart, gonna try it soon.</p>]]></description>
			<author><![CDATA[dummy@example.com (255)]]></author>
			<pubDate>Wed, 23 Oct 2013 18:49:53 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5751#p5751</guid>
		</item>
		<item>
			<title><![CDATA[Re: X-Ray, Z-order, draw 3d objects order]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5749#p5749</link>
			<description><![CDATA[<p>actually I taught about something even simpler :</p><div class="codebox"><pre><code>void MyGame::draw(void)
{
    // here make all x-ray objects invisible
    ...

    // draw the scene without x-ray objects
    MGame::draw();

    // clear depth buffer
    render-&gt;clear(M_BUFFER_DEPTH);

    // here make all x-ray objects visible, and others invisible
    ...

    // draw x-ray objects only
    scene-&gt;draw(camera); // [EDIT]
}</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Wed, 23 Oct 2013 18:35:41 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5749#p5749</guid>
		</item>
		<item>
			<title><![CDATA[Re: X-Ray, Z-order, draw 3d objects order]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5743#p5743</link>
			<description><![CDATA[<p>So I could use the first solution and maybe post a feature request for this last idea?<br />X-Ray is used a lot in games anyway.</p>]]></description>
			<author><![CDATA[dummy@example.com (255)]]></author>
			<pubDate>Wed, 23 Oct 2013 14:54:21 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5743#p5743</guid>
		</item>
		<item>
			<title><![CDATA[Re: X-Ray, Z-order, draw 3d objects order]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5742#p5742</link>
			<description><![CDATA[<p>the first method is not necessarily slow as you can either deactivate the x-ray objects in the main scene when they are in x-ray, or have the x-ray objects only in the secondary scene from the beginning (if they are always seen in x-ray).</p><p>Other solution is to add an option in MMaterial to ignore depth-test so the object won&#039;t be affected by the z-buffer,<br />but your material should use an additive blending mode to avoid self intersection issues (additive blending can be render in any order).</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Wed, 23 Oct 2013 14:17:54 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5742#p5742</guid>
		</item>
		<item>
			<title><![CDATA[Re: X-Ray, Z-order, draw 3d objects order]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5741#p5741</link>
			<description><![CDATA[<p>The first solution is maybe not so good in performances? And anyway having two scenes and two cameras and one camera should copy the movements of the other camera, and same for the entity, I don&#039;t like it much. But the second solution doesn&#039;t seem much doable because I would need to access private methods of MRenderer.<br />My code is as follows:<br /></p><div class="codebox"><pre><code>//custom draw
void MyGame::draw(void)
{
    MGame::draw();

    MRenderingContext* rendering = engine-&gt;getRenderingContext();
    rendering-&gt;disableDepthTest();
    MRenderer * renderer = engine-&gt;getRenderer();

    MOEntity * entity = myEntity;
    MMesh * mesh = entity-&gt;getMesh();
    MSubMesh* smeshs = mesh-&gt;getSubMeshs();
    MVector3* vertices = smeshs[0].getVertices();
    MVector3* normals = smeshs[0].getNormals();
    MVector3 * tangents = ?
    MColor * colors = ?
    renderer-&gt;drawDisplay(smeshs[0],smesh[0].getDisplay(0),vertices,normals,tangents,colors); //not accessible</code></pre></div><p>I could only do -&gt;drawScene but that will be pointless unless I have another scene which bring us in the first solution again.<br />Hrm.. I need some renderer-&gt;drawEntity() method lol.</p>]]></description>
			<author><![CDATA[dummy@example.com (255)]]></author>
			<pubDate>Wed, 23 Oct 2013 13:57:58 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5741#p5741</guid>
		</item>
		<item>
			<title><![CDATA[Re: X-Ray, Z-order, draw 3d objects order]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5740#p5740</link>
			<description><![CDATA[<p>x-ray, ok, so what I say previously is not totally related.</p><p>there is multiple ways to do it,</p><p>I think the simpler way would be to create a second scene where you put only the objects you want to draw in xray.<br />Use a clone of the main scene camera to syncronise the perspective and render this scene on top of the main scene as a camera-layer : <a href="http://wiki.maratis3d.org/index.php?title=EnableCameraLayer">http://wiki.maratis3d.org/index.php?tit &#133; ameraLayer</a></p><p>Another way would be to do that by hand in MGame::draw,<br />after the scene draw, you disable the depth test with MRenderingContext and you render the x-ray objects after.</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Wed, 23 Oct 2013 12:52:12 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5740#p5740</guid>
		</item>
		<item>
			<title><![CDATA[Re: X-Ray, Z-order, draw 3d objects order]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5739#p5739</link>
			<description><![CDATA[<div class="quotebox"><cite>anael wrote:</cite><blockquote><p>To sort objects you can use MCore&#039;s &quot;sortFloatList(int indexList[], float floatList[], int start, int end)&quot;</p></blockquote></div><p>Thank you it may be that one, I&#039;ll try soon.<br /></p><div class="quotebox"><blockquote><p>But all depends on what you want to achieve.</p></blockquote></div><p><strong>x-ray</strong>! How could it not came to my mind! That&#039;s the word. So e.g. in a futuristic game you see behind a wall a 3d object that you couldn&#039;t see because the wall is rendered after it. I&#039;ll add the term in the thread title.<br />It&#039;s even used in Blender for the armature.</p>]]></description>
			<author><![CDATA[dummy@example.com (255)]]></author>
			<pubDate>Wed, 23 Oct 2013 08:12:24 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5739#p5739</guid>
		</item>
		<item>
			<title><![CDATA[Re: X-Ray, Z-order, draw 3d objects order]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5738#p5738</link>
			<description><![CDATA[<p>do you mean the general painter&#039;s algorithm ? (was used for real time software 3d before the z buffer technique)</p><p>or do you just want to do a special effect ?</p><p>in Maratis the rendering order is managed by MRenderer (here fixedRenderer or standardRenderer),<br />in the standardRenderer it happen globally like that :</p><p>- get the list of objects visible in the camera view<br />- render all non-transparent sub-meshs from near to far in depth-test only (early Z test) and build occlusion culling<br />- render occlusion-culled non-transparent sub-meshs in random order<br />- render transparent sub-meshs in far to near order</p><p>It&#039;s a bit different in the iOS renderer for example (no early z test because iphone and iPad 3d card uses tiled rendering).</p><p>To sort objects you can use MCore&#039;s &quot;sortFloatList(int indexList[], float floatList[], int start, int end)&quot;</p><p>But all depends on what you want to achieve.</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Wed, 23 Oct 2013 08:06:43 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5738#p5738</guid>
		</item>
		<item>
			<title><![CDATA[Re: X-Ray, Z-order, draw 3d objects order]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5737#p5737</link>
			<description><![CDATA[<p>The clipping plane is <em>how much far</em> and <em>how much close</em> objects can be drawn.<br />The draw distance it&#039;s the quality of the distant objects (e.g. viewing a big city from a very distant position and you see good skyscreapers; this relates to <a href="http://en.wikipedia.org/wiki/Level_of_detail">LOD</a>).<br />So both terms don&#039;t relate to what I&#039;m asking; &quot;z-order&quot; sounds more correct in this case, even if it&#039;s generally used in 2d.</p>]]></description>
			<author><![CDATA[dummy@example.com (255)]]></author>
			<pubDate>Wed, 23 Oct 2013 08:06:38 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5737#p5737</guid>
		</item>
		<item>
			<title><![CDATA[Re: X-Ray, Z-order, draw 3d objects order]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5733#p5733</link>
			<description><![CDATA[<div class="quotebox"><cite>255 wrote:</cite><blockquote><p>I think there is a specific term for this, but it doesn&#039;t come to mind.<br />By the way I want to render a 3D object before everything else even if it&#039;s far from the camera, so I can e.g. show what&#039;s behind a wall.</p></blockquote></div><p>The first phrase that came to mind was &quot;Clipping Plane&quot;<br />The 2nd word that came to mind was &quot;Draw Distance.&quot;</p><p>I think the 2nd one is the term.</p><p>Edit: Seems like both of those terms are good ones to research. They seem to work sorta the same. You could use one or both techniques. The term &quot;Clipping Path&quot; came up while researching Clipping Plane.</p>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Wed, 23 Oct 2013 03:37:17 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5733#p5733</guid>
		</item>
		<item>
			<title><![CDATA[X-Ray, Z-order, draw 3d objects order]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=5731#p5731</link>
			<description><![CDATA[<p>I think there is a specific term for this, but it doesn&#039;t come to mind.<br />By the way I want to render a 3D object before everything else even if it&#039;s far from the camera, so I can e.g. show what&#039;s behind a wall.</p><p>EDIT: thread title edited</p>]]></description>
			<author><![CDATA[dummy@example.com (255)]]></author>
			<pubDate>Tue, 22 Oct 2013 22:29:25 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=5731#p5731</guid>
		</item>
	</channel>
</rss>
