<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Iso 2D engine using CG Shaders [video]</title>
		<link>http://www.allegro.cc/forums/view/606198</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 08 Feb 2011 02:40:08 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So I&#39;ve been playing around with this pretty much all day, just placing and rendering random objects. So much fun that I felt like recording a video to show this!</p><p>[The video is inside the spoiler since the new thumbnail size is messing with the forum, but once you click it, it&#39;ll play fine!]
</p><div class="spoiler"><p><div class="media-player youtube"><div style="margin: 1em 2em; background: url(/images/movie.png); width: 180px; height: 100px; text-align: center;"><a href="http://www.allegro.cc//www.youtube.com/watch?v=U1Ahytyuwgg" target="_blank"><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/object/d/9/d9ed769d873c1c00b89d5fb222a97e1a.jpg" border="0" alt="video" title="Click to play video" /></a></div></div></p></div><p>

I saw a guy long time ago doing something like this(and quite better in some ways) using XNA, but since he kind of disappeared and never heard from him of releasing the engine, I just started playing with the idea.</p><p>Til now, it features the dynamic lighting showed off, and shadows casted by the directional light. They&#39;re not really accurate, but I think they look great. Trying to figure out how to do shadows casted by the dynamic lights as well.</p><p>And this must&#39;ve been the simplest thing I ever wrote! Just two fragment shaders, some math and some bitmaps. It&#39;s built on Allegro 5 + the CG shaders. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><p>I&#39;m looking for feedback on how could I improve the looks even more. Maybe ambient occlusion? Bloom? <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> I was thinking of trying out water next.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Thu, 27 Jan 2011 00:35:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You should add collision instead of occlusion.</p><p>It&#39;s a nice thing thought.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Thu, 27 Jan 2011 00:52:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s pretty cool.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900467#target">Dario ff</a> said:</div><div class="quote"><p>I&#39;m looking for feedback on how could I improve the looks even more.</p></div></div><p>For the fun of it, how about a depth of field blur since you have the depth map.</p><p>What does it look like with the shaders turned off? <img src="http://www.allegro.cc/forums/smileys/cool.gif" alt="8-)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Thu, 27 Jan 2011 01:08:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900476#target">Mark Oates</a> said:</div><div class="quote"><p>For the fun of it, how about a depth of field blur since you have the depth map.</p></div></div><p>
I must admit that for some reason, I hate depth of field blurs. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /> Anyway, I don&#39;t think it&#39;d work well since it&#39;s not a perspective camera, it&#39;s isometric. And iso isn&#39;t really doing &quot;focus&quot; on a particular point.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>What does it look like with the shaders turned off? <img src="http://www.allegro.cc/forums/smileys/cool.gif" alt="8-)" /></p></div></div><p>
Like the first part of the video. I even lowered the quality of the music in that part to show how crappy it looks with no lighting. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /> And it wouldn&#39;t have any object intersections at all.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Thu, 27 Jan 2011 01:13:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I like that... Could you attach the .exe? it&#39;s possible?</p><p>I don&#39;t like using 3D models with static cameras because you have to create an entire model and just one side is going to be visible... </p><p>But I really like isometrics games in 3D, with some perspective it looks really awesome. So I&#39;m always thinking in a way to create a 3D world using an static camera, but take advantage of the entire mesh, material and texture...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AMCerasoli)</author>
		<pubDate>Thu, 27 Jan 2011 02:30:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900504#target">AMCERASOLI</a> said:</div><div class="quote"><p>But I really like isometrics games in 3D, with some perspective it looks really awesome.</p></div></div><p>
But... then it&#39;s not isometric. <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /> It&#39;s just a camera angle.</p><p>EDIT: Mine isn&#39;t perfect isometric either, <s>I think it&#39;s called an ortographic projection actually. But it doesn&#39;t take perspective into account.</s> Bleh, I don&#39;t really know how it&#39;s called. It&#39;s just isometric with a slightly modified angle.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Thu, 27 Jan 2011 03:41:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You probably mean orthogonal. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /><br />Anyway, it&#39;s looking really nice! Keep up the good work!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (imaxcs)</author>
		<pubDate>Thu, 27 Jan 2011 03:56:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Where is the exe? where is the exe?!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AMCerasoli)</author>
		<pubDate>Thu, 27 Jan 2011 04:02:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900520#target">imaxcs</a> said:</div><div class="quote"><p>You probably mean orthogonal.</p></div></div><p>
Ah, I knew I was close, thanks. Pure isometric doesn&#39;t look really good IMO, I prefer the style used in the Infinity Engine games. It uses as similar angle, but slightly rotated.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900522#target">AMCERASOLI</a> said:</div><div class="quote"><p>Where is the exe? where is the exe?!</p></div></div><p>
Umm, wouldn&#39;t you prefer I at least put some editor&#39;s functions, like selecting and moving the objects? It&#39;s all big one hack at the moment just moving the pilar, the robot, and the sphere. <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /></p><p>(And you could screw up the whole lighting by just pressing random buttons)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Thu, 27 Jan 2011 04:06:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You were right from the start with orthographic (if no perspective is involved). <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /><br />(And an isometric projection is a special case of orthographic projection, where the projected unit axes are the same length with an angle of 120 degrees between each other)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Thu, 27 Jan 2011 06:10:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Looks frikkin awesome to me! Nice work.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dizzy Egg)</author>
		<pubDate>Thu, 27 Jan 2011 14:39:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I remember watching the original ages ago and this look just the same. Keep it up and turn it into a useable api <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Thu, 27 Jan 2011 18:16:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900533#target">gnolam</a> said:</div><div class="quote"><p>You were right from the start with orthographic (if no perspective is involved)</p></div></div><p>
Then orthographic it is, I guess.</p><p>I&#39;m trying out another angle camera at the moment and it looks sweet. Much better IMO. Compare the house to the one in the video for reference.<br /><span class="remote-thumbnail"><span class="json">{"name":"603208","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/3\/d377a9a9895980e4fd8fa13ded954b6a.png","w":629,"h":468,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/3\/d377a9a9895980e4fd8fa13ded954b6a"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/d/3/d377a9a9895980e4fd8fa13ded954b6a-240.jpg" alt="603208" width="240" height="178" /></span><br />I built it in a way that it&#39;s quite easy to change the projection settings. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> The thing is I have to render again all the objects.</p><p>And I&#39;ve discovered there was a pretty horrible bug on the depth rendering, so yeah, quite a big part of the video was rendering it wrong. <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /> (At least the parts where the objects were elevated)</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900617#target">Neil Walker</a> said:</div><div class="quote"><p>Keep it up and turn it into a useable api</p></div></div><p>
Yeah, it can be easily plugged in since it just uses a Renderer class, a Camera, and the list of objects and lights. So just calling the renderer when drawing the frame should do all the work. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /> I need to do a usable editor though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Thu, 27 Jan 2011 23:46:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I wouldn&#39;t push the boat out on an api or editor unless you really want to. The one here:<br /><a href="http://retrospec.sgn.net/users/ignacio/isoeng.htm">http://retrospec.sgn.net/users/ignacio/isoeng.htm</a></p><p>Has only attracted 1500 in 6 years <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Fri, 28 Jan 2011 00:32:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Maybe a clean API for everyone isn&#39;t really needed, but an editor would be a must. And I have all my GUI code to reuse anyway.</p><p>I think you showed me <i>isomot</i> in the past. Must&#39;ve been another of my isometric engine threads. <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Fri, 28 Jan 2011 00:40:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Wow! looking great!<br />Waiting for a wip version <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Jones64)</author>
		<pubDate>Fri, 28 Jan 2011 02:07:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><a href="https://sites.google.com/site/ffstadium/css-dump/terra-ge.7z">Here you go so you can play around a bit</a>.<br />It isn&#39;t optimized at all, so framerate drops might be possible. And I&#39;m not sure if the shader even works on most cards.</p><p>F1 - Show/Hide light positions.<br />F2 - Toggle Height Map<br />F3 - Toggle Normals<br />F4 - Toggle Lighting<br />F5 - Toggle Editor mode.</p><p>It might lag quite a bit more in editor mode since I&#39;m just using al_get_pixel to know if I&#39;m picking a certain object. I will replace that later.</p><p>In the editor, select an object with the middle click. Left click to move it to an X/Y position, and hold right click and move up/down to change Z. If you hold Left control while using right click, you can scale the objects.</p><p>It should adapt to your display&#39;s desktop resolution in the fake fullscreen mode. If not, you can replace some settings in the .ini.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Fri, 28 Jan 2011 02:39:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I ran your program, and there was about 30 seconds of black screen, then the screen turned gray. I messed around with the F-keys and F5 brought up a view of an isometric tiled square with a pale brownish texture on it. F1 drew a little yellow circle and a vertical line on the screen. Whatever it was supposed to do, I don&#39;t think it did. Of course this is on my laptop, with crappy onboard graphics though.</p><p>What was it supposed to look like?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 28 Jan 2011 04:41:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Nothing like that really. It&#39;s just that the shader doesn&#39;t compile for some reason since I&#39;m still learning about profiles. I tried with a 6100 and pretty much the same happened.</p><p>What&#39;s your GPU model?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Fri, 28 Jan 2011 04:57:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>ATI Radeon X1270.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 28 Jan 2011 05:01:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s an integrated GPU right? I didn&#39;t really expect it to run well on that hardware...</p><p>All I guess you could try is going to the assets/shader folder and replace the profile in the .cgfx files with a text editor. Try out the glslf profile. The line is near the end of the file.</p><p>For example:<br /><span class="source-code">FragmentProgram <span class="k3">=</span> compile latest ps_main<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></span><br />to<br /><span class="source-code">FragmentProgram <span class="k3">=</span> compile glslf ps_main<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></span></p><p>And the loading time is because the bitmaps are pretty big. <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /></p><p>EDIT: I&#39;ve always had some quirks when using the CG Effects file when compiling. I remember being able to compile almost anything by just extracting the fragment shader program from the first pass without anything else.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Fri, 28 Jan 2011 05:07:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The mouse doesn&#39;t work for me and the scrolling is really slow and jumpy, probably because I&#39;m only getting 8fps according to fraps.</p><p>I&#39;ve got an nvidia geforce 8400m gs running on an intel core 2 duo T8100.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Fri, 28 Jan 2011 05:08:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://">Edgar Reynaldo</a> said:</div><div class="quote"><p>I ran your program, and there was about 30 seconds of black screen, then the screen turned gray. I messed around with the F-keys and F5 brought up a view of an isometric tiled square with a pale brownish texture on it. F1 drew a little yellow circle and a vertical line on the screen.</p></div></div><p>

I had the same problem... then I changed the game_config.ini file to see the program in windowed mode.. and the console after the gray screen says &quot;Technique lighting did not validate. Skipping.&quot;</p><p>then I wrote in the console: &quot;don&#39;t skip please&quot;</p><p>and then the computer wrote &quot;Sorry...&quot; and the program closed...</p><p>EDIT: BTW my graphic car is also an ATI 12..something... in a laptop...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AMCerasoli)</author>
		<pubDate>Fri, 28 Jan 2011 05:08:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ll try my luck in just extracting the shader program rather than using the full CGFX file.</p><p>EDIT: For reference, my GPU is an NVidia Geforce 9600 GT. I get 60fps almost all the time. Integrated GPUs have never worked well for me when shaders are involved. <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Fri, 28 Jan 2011 05:11:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I should add I have a laptop so it&#39;s the mobile version of the card, but dedicated non the less and is DX9 compatible.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Fri, 28 Jan 2011 05:13:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900756#target">Dario ff</a> said:</div><div class="quote"><p>
Try out the glslf profile.
</p></div></div><p>
This time after the black screen I got a white screen with a dark grey rectangle with a cutout on the bottom of the screen. F5 showed an isometric diamond outline on the screen.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 28 Jan 2011 05:22:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yup, it seems again, my code never builds on an ATI GPU! <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" /></p><p>I&#39;ll be able to debug this later more properly with a friend, so don&#39;t worry. It&#39;ll work, it&#39;s just that there are always some quirks I forget.</p><p>EDIT: Yeah, I did the same stupid mistake I did once of mixing up ints and floats. NVidia GPUs are more forgiving in that, and it&#39;s been nearly an year from using these that I forgot, sorry. Wait for take #2. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Fri, 28 Jan 2011 05:31:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://">Dario ff</a> said:</div><div class="quote"><p>Yup, it seems again, my code never builds on an ATI GPU! </p><p>I&#39;ll be able to debug this later more properly with a friend, so don&#39;t worry. It&#39;ll work, it&#39;s just that there are always some quirks I forget. </p></div></div><p>

Yes yes yes... I want my money back.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AMCerasoli)</author>
		<pubDate>Fri, 28 Jan 2011 05:37:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Try out these two shaders if you want. They&#39;re pretty horrible at the moment regarding optimizations obviously, but I didn&#39;t really expect to even put something like it online. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Fri, 28 Jan 2011 05:43:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Wow! this looks really impressive!. I thought it was 3D until that part where you say it&#39;s 2D. Actually, I could&#39;ve bet that it&#39;s 3D.</p><p>Nice work!.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kenmasters1976)</author>
		<pubDate>Fri, 28 Jan 2011 09:53:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Does not work there.<br />Symptoms are the same as Edgar, 30 second black, and a grey background after.</p><p>And the good news is that it&#39;s running at my display refresh rates ;-)</p><p>&quot;Technique lighting did not validate. Skipping.&quot;</p><p>Edit: BTW I have a Radeon 5470 and MediaPlayerClassic let me play with it&#39;s shaders without problems. I use the latests drivers, 10.12, on W7 64.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Fri, 28 Jan 2011 15:04:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Works here: nvidia geforce 8600GT.</p><p>EDIT: Forgot to say: <b>awesome</b>. <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Vanneto)</author>
		<pubDate>Fri, 28 Jan 2011 16:32:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900844#target">GullRaDriel</a> said:</div><div class="quote"><p>Does not work there.<br />Symptoms are the same as Edgar, 30 second black, and a grey background after.</p></div></div><p>
Did you try the shaders I attached in the last post? Those fixed the problem I had with seeing just a white texture in an integrated 6100GT. Of course, it works incredibly slow, because it&#39;s a very crappy card. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>Of course, it could be that it&#39;s still not compiling on ATI, but I can debug that one more in detail later.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900816#target">kenmasters1976</a> said:</div><div class="quote"><p>I thought it was 3D until that part where you say it&#39;s 2D. Actually, I could&#39;ve bet that it&#39;s 3D.</p></div></div><p>
If I rendered much more awesome models(and textured) it would&#39;ve been more obvious. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> I think the tiles are a pretty good example, those look great since they&#39;re textured.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900851#target">Vanneto</a> said:</div><div class="quote"><p>Works here: nvidia geforce 8600GT.</p></div></div><p>
Cool, that&#39;s my old card.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Fri, 28 Jan 2011 20:20:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Dario ff said:</div><div class="quote"><p>
Did you try the ones I attached in the last post?
</p></div></div><p>
Using the two new shaders you posted had the same result as the last time I tried it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 28 Jan 2011 20:32:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The shadow shader seems to be compiling correctly, it&#39;s the lighting the one with the problem.</p><p>Well, I wouldn&#39;t know how to debug it without a card for sure. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /> All I can say is if you want, start commenting parts, except these lines:
</p><div class="spoiler"><p>
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">struct</span> PS_OUTPUT
<span class="k2">{</span>
    float4 color <span class="k2">:</span> COLOR0<span class="k2">;</span>
    <span class="k1">float</span> depth <span class="k2">:</span> DEPTH<span class="k2">;</span>
<span class="k2">}</span><span class="k2">;</span>

PS_OUTPUT ps_main<span class="k2">(</span>float2 normalMapTexCoord <span class="k2">:</span> TEXCOORD0<span class="k2">)</span>
<span class="k2">{</span>

    PS_OUTPUT Out<span class="k2">;</span>
    float4 color<span class="k2">;</span>
</pre></div></div><p>

</p><div class="source-code snippet"><div class="inner"><pre>color <span class="k3">=</span> tex2D<span class="k2">(</span>texture, normalMapTexCoord<span class="k2">)</span><span class="k2">;</span>
Out.color <span class="k3">=</span> color<span class="k2">;</span>
</pre></div></div><p>

</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">return</span> Out<span class="k2">;</span>

technique lighting <span class="k2">{</span>
  pass <span class="k2">{</span>
    FragmentProgram <span class="k3">=</span> compile glslf ps_main<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
    VertexProgram <span class="k3">=</span> NULL<span class="k2">;</span>
  <span class="k2">}</span>
<span class="k2">}</span>
</pre></div></div><p>
</p></div><p>
So yeah, you can comment pretty much everything inside ps_main(). If you see something visible, then you can try adding more and more lines until it screws up. That would help, if you&#39;re willing to do that.</p><p>EDIT: Oh, and don&#39;t comment the global variables that are above ps_main. Otherwise, the program will fail when setting them.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Fri, 28 Jan 2011 20:45:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900867#target">Dario ff</a> said:</div><div class="quote"><p>float4 color : COLOR0;<br />    float depth : DEPTH;<br />PS_OUTPUT ps_main(float2 normalMapTexCoord : TEXCOORD0)
</p></div></div><p>

The colons are baffling me? There are many voids in my C/C++ knowledge but all of them I thought I knew what I didn&#39;t know. But not these.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Fri, 28 Jan 2011 21:28:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s CG, not C++. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /> Unless I misunderstood what you said.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Fri, 28 Jan 2011 21:31:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, that shows I should read the whole thread instead of random bits and why I didn&#39;t follow the syntax. I guess if I read all the code and saw the lighting bit at the end I might have realised something was up.</p><p>Still, glad to see there&#39;s nothing I don&#39;t know about C/C++ that I didn&#39;t already know I didn&#39;t know <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Fri, 28 Jan 2011 21:48:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I tested it just now, it&#39;s pretty impressive <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />  <br />I haven&#39;t seen much of this way of 2D rendering before. Do you have any plans of making a full engine or a game with this? Would be interesting :p</p><p>Performance seems fine, but one thing I noticed is that the application uses about 236MB of video memory. Will this increase a lot if you build this into a full game?</p><p>Works smooth with a GeForce 8800GT in Win7-64.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Jones64)</author>
		<pubDate>Fri, 28 Jan 2011 22:14:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900876#target">Jones64</a> said:</div><div class="quote"><p>Performance seems fine, but one thing I noticed is that the application uses about 236MB of video memory.</p></div></div><p>
Well, the images I included had some useless empty spaces, and were very high-res, so it&#39;s expected. I could map the height map into the normal&#39;s alpha channel to reduce it 1/3 <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />. And the shadow map is unnecesarily big as well, and I&#39;ll try to optimize it so it gets cropped as well. That should reduce the usage to a bit more than 1 half probably.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Fri, 28 Jan 2011 22:19:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900851#target">Vanneto</a> said:</div><div class="quote"><p>Works here: nvidia geforce 8600GT.</p></div></div><p>That&#39;s the card I have!
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900865#target">Dario ff</a> said:</div><div class="quote"><p>Cool, that&#39;s my old card.
</p></div></div><p>It&#39;s my <i>new</i> card. <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /></p><p>Then again, I did buy it like 2 years ago.  That&#39;s &quot;new&quot; to me, since I&#39;m old now.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Fri, 28 Jan 2011 22:35:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900878#target">Mark Oates</a> said:</div><div class="quote"><p>
That&#39;s the card I have!
</p></div></div><p>
That&#39;s the same card my friend has. <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /> He&#39;s looking into a 460 for an upgrade. (Only $160)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Fri, 28 Jan 2011 23:02:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900867#target">Dario ff</a> said:</div><div class="quote"><p>
So yeah, you can comment pretty much everything inside ps_main(). If you see something visible, then you can try adding more and more lines until it screws up. That would help, if you&#39;re willing to do that.
</p></div></div><p>

Speaking of the second object_light.cgfx :</p><p>First, I went back to using <br /><span class="source-code">    FragmentProgram <span class="k3">=</span> compile latest ps_main<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></span></p><p>Then if I comment out lines 79-234 (everything), then I get to see the assorted isometric diamond floors, the mansion, the guy in armor, and the column. I tried to take a screen shot, but it captures the desktop underneath for some reason.</p><p>If I comment out line 219<br /><span class="source-code"><span class="c">//    Out.color = color;</span></span><br />and line 233<br /><span class="source-code"><span class="c">//    Out.depth = 1.0-depth;</span></span><br />which effectively returns the color retrieved from the Tex2D call at the beginning, then I get a gray screen, which makes no sense, since it is returning the same PS_OUTPUT as it was when I commented everything out.</p><p>If I comment out lines 113-158 (the <span class="source-code"><span class="k1">while</span> <span class="k2">(</span>i<span class="k3">&lt;</span><span class="n">32</span><span class="k2">)</span> <span class="k2">{</span></span> block), then I get a gray screen again, so I don&#39;t think there&#39;s anything wrong with that chunk of code.</p><p>If I comment out lines 161-203 (the <span class="source-code"><span class="k1">if</span> <span class="k2">(</span>directional_strength <span class="k3">&gt;</span> <span class="n">0</span><span class="k2">)</span> <span class="k2">{</span></span> block, then I still get a gray screen.</p><p>If I comment out lines 113-203 (both of the previous blocks of code) then I get a gray screen with all the objects in black, which makes sense since final_light is initialized to 0.0.</p><p>What values of final_light would make every color turn grey(transparent?)?</p><p>I don&#39;t really know how I could isolate the problem anymore.</p><p>Something else that doesn&#39;t make sense is why it works for some people, but not for others. All ps_main is doing is returning a color, and that should be the same for everyone.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 28 Jan 2011 23:03:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Interesting. Could you do another test? Try <a href="http://www.allegro.cc/files/attachment/603227">these</a> and replace object_light by renaming each of these.</p><p>Version _a will just pass the color and output with no depth whatsoever. So you&#39;ll likely see an isometric floor.</p><p>Version _b will pass both color and depth, but no lighting whatsoever.</p><p>Version _c will pass the directional light, but it won&#39;t cast any shadows.</p><p>Version _d will pass the directional light and cast shadows.</p><p>I&#39;ve removed the parts for iluminating with dynamic lights. The full version would be the one you already have. If one of the versions doesn&#39;t work, then we&#39;ve narrowed down the culprit. The reason it&#39;s grey is that it&#39;s most likely not compiling well. A final_light with a value of 0 would just turn it black.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Fri, 28 Jan 2011 23:19:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>All four versions have the same result, a white screen with dark grey cutout rectangle on the bottom of the screen.</p><p>I changed all the <br /><span class="source-code">    FragmentProgram <span class="k3">=</span> compile glslf ps_main<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></span><br />to<br /><span class="source-code">    FragmentProgram <span class="k3">=</span> compile latest ps_main<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></span><br />and reran each test.</p><p>Results :</p><p>version _a -<br />Displayed all the objects.</p><p>version _b -<br />Same as _a.</p><p>version _c -<br />Looked somehow different than _a and _b, and the column was tinted pink.</p><p>version _d -<br />Only showed a gray screen.</p><p>So it looks like the problem is with casting shadows somehow.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Fri, 28 Jan 2011 23:45:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Great. Version _d only has this (horrible I know) chunk of code added:</p><div class="spoiler"><p>
</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span>     <span class="k1">if</span> <span class="k2">(</span>tz <span class="k3">&lt;</span> shadow_f<span class="k2">)</span> <span class="k2">{</span>
<span class="number">  2</span>            float4 new_col<span class="k2">;</span>
<span class="number">  3</span>            <span class="k1">float</span> al<span class="k2">;</span>
<span class="number">  4</span>            al <span class="k3">=</span> <span class="n">1</span>.<span class="n">0</span><span class="k2">;</span>
<span class="number">  5</span>
<span class="number">  6</span>            new_col <span class="k3">=</span> tex2D<span class="k2">(</span>texture_shadow_map, screen_pos<span class="k3">+</span>float2<span class="k2">(</span><span class="k2">(</span><span class="n">2</span>.<span class="n">0</span><span class="k3">/</span>screen_w<span class="k2">)</span>, <span class="k2">(</span><span class="n">2</span>.<span class="n">0</span><span class="k3">/</span>screen_h<span class="k2">)</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  7</span>            <span class="k1">float</span> shadow_t<span class="k2">;</span>
<span class="number">  8</span>            shadow_t <span class="k3">=</span> new_col.r<span class="k3">*</span><span class="n">255</span>.<span class="n">0</span> <span class="k3">+</span> new_col.g<span class="k3">*</span><span class="n">255</span>.<span class="n">0</span><span class="k3">*</span><span class="n">255</span>.<span class="n">0</span><span class="k2">;</span>
<span class="number">  9</span>            <span class="k1">if</span> <span class="k2">(</span>tz <span class="k3">&lt;</span> shadow_t<span class="k2">)</span> al<span class="k3">+</span><span class="k3">=</span><span class="n">1</span>.<span class="n">0</span><span class="k2">;</span>
<span class="number"> 10</span>
<span class="number"> 11</span>            new_col <span class="k3">=</span> tex2D<span class="k2">(</span>texture_shadow_map, screen_pos<span class="k3">+</span>float2<span class="k2">(</span><span class="k2">(</span><span class="n">2</span>.<span class="n">0</span><span class="k3">/</span>screen_w<span class="k2">)</span>, <span class="k2">(</span><span class="k3">-</span><span class="n">2</span>.<span class="n">0</span><span class="k3">/</span>screen_h<span class="k2">)</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 12</span>            shadow_t <span class="k3">=</span> new_col.r<span class="k3">*</span><span class="n">255</span>.<span class="n">0</span> <span class="k3">+</span> new_col.g<span class="k3">*</span><span class="n">255</span>.<span class="n">0</span><span class="k3">*</span><span class="n">255</span>.<span class="n">0</span><span class="k2">;</span>
<span class="number"> 13</span>            <span class="k1">if</span> <span class="k2">(</span>tz <span class="k3">&lt;</span> shadow_t<span class="k2">)</span> al<span class="k3">+</span><span class="k3">=</span><span class="n">1</span>.<span class="n">0</span><span class="k2">;</span>
<span class="number"> 14</span>
<span class="number"> 15</span>            new_col <span class="k3">=</span> tex2D<span class="k2">(</span>texture_shadow_map, screen_pos<span class="k3">+</span>float2<span class="k2">(</span><span class="k2">(</span><span class="k3">-</span><span class="n">2</span>.<span class="n">0</span><span class="k3">/</span>screen_w<span class="k2">)</span>, <span class="k2">(</span><span class="n">2</span>.<span class="n">0</span><span class="k3">/</span>screen_h<span class="k2">)</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 16</span>            shadow_t <span class="k3">=</span> new_col.r<span class="k3">*</span><span class="n">255</span>.<span class="n">0</span> <span class="k3">+</span> new_col.g<span class="k3">*</span><span class="n">255</span>.<span class="n">0</span><span class="k3">*</span><span class="n">255</span>.<span class="n">0</span><span class="k2">;</span>
<span class="number"> 17</span>            <span class="k1">if</span> <span class="k2">(</span>tz <span class="k3">&lt;</span> shadow_t<span class="k2">)</span> al<span class="k3">+</span><span class="k3">=</span><span class="n">1</span>.<span class="n">0</span><span class="k2">;</span>
<span class="number"> 18</span>
<span class="number"> 19</span>            new_col <span class="k3">=</span> tex2D<span class="k2">(</span>texture_shadow_map, screen_pos<span class="k3">+</span>float2<span class="k2">(</span><span class="k2">(</span><span class="k3">-</span><span class="n">2</span>.<span class="n">0</span><span class="k3">/</span>screen_w<span class="k2">)</span>, <span class="k2">(</span><span class="k3">-</span><span class="n">2</span>.<span class="n">0</span><span class="k3">/</span>screen_h<span class="k2">)</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 20</span>            shadow_t <span class="k3">=</span> new_col.r<span class="k3">*</span><span class="n">255</span>.<span class="n">0</span> <span class="k3">+</span> new_col.g<span class="k3">*</span><span class="n">255</span>.<span class="n">0</span><span class="k3">*</span><span class="n">255</span>.<span class="n">0</span><span class="k2">;</span>
<span class="number"> 21</span>            <span class="k1">if</span> <span class="k2">(</span>tz <span class="k3">&lt;</span> shadow_t<span class="k2">)</span> al<span class="k3">+</span><span class="k3">=</span><span class="n">1</span>.<span class="n">0</span><span class="k2">;</span>
<span class="number"> 22</span>
<span class="number"> 23</span>            al <span class="k3">/</span><span class="k3">=</span> <span class="n">5</span>.<span class="n">0</span><span class="k2">;</span>
<span class="number"> 24</span>            luminance2 <span class="k3">-</span><span class="k3">=</span> <span class="n">0</span>.<span class="n">12</span><span class="k3">*</span>al<span class="k3">*</span>directional_strength<span class="k2">;</span>
<span class="number"> 25</span>        <span class="k2">}</span>
</div></div><p>
</p></div><p>

So I guess you can comment there and see what happens. My guess is that ATI doesn&#39;t allow to read from outside the texture, so that&#39;s why it crashes probably. If commenting those lines between al=1.0; and al /= 5.0; works, then it&#39;s that I guess. I&#39;ll try and fix those coordinates inside the texture&#39;s limits.</p><p>EDIT: Try the <a href="http://www.allegro.cc/files/attachment/603229">attached shader</a> if you want. And thanks, this will help me a lot later. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Fri, 28 Jan 2011 23:51:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Using version _d, if I comment out this line :<br /><span class="source-code">            luminance2 <span class="k3">-</span><span class="k3">=</span> <span class="n">0</span>.<span class="n">12</span><span class="k3">*</span>al<span class="k3">*</span>directional_strength<span class="k2">;</span></span><br />Then it displays like version _c, with a pink glow on the column and rectangular prism.</p><p><b>Edit for your edit :</b><br />I tried the shader you attached in your last post, and it was back to the white screen with dark grey cutout rectangle again. I changed &#39;compile glslf&#39; to &#39;compile latest&#39; again, and then it was back to the gray screen.</p><p>If I comment out the same line I did with version _d, then it works like version _c again.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 29 Jan 2011 00:23:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I see. Then I guess you should try either:</p><p>luminance2 -= 0.12;<br />or<br />luminance2 -= 0.12*al;<br />or<br />luminance2 -= 0.12*directional_strength;</p><p>To see which of them won&#39;t let it compile.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Sat, 29 Jan 2011 00:28:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Using all the different combinations you posted, I still get a gray screen.</p><p>I just noticed on line 218 you have this :<br /><span class="source-code">        <span class="k1">if</span> <span class="k2">(</span>luminance2 <span class="k3">&lt;</span> <span class="n">0</span>.<span class="n">0</span><span class="k2">)</span> luminance <span class="k3">=</span> <span class="n">0</span>.<span class="n">0</span><span class="k2">;</span></span></p><p>See how it sets luminance to 0.0 instead of luminance2?</p><p>Well I changed it to :<br /><span class="source-code">        <span class="k1">if</span> <span class="k2">(</span>luminance2 <span class="k3">&lt;</span> <span class="n">0</span>.<span class="n">0</span><span class="k2">)</span> luminance2 <span class="k3">=</span> <span class="n">0</span>.<span class="n">0</span><span class="k2">;</span></span><br />and I still get a gray screen.</p><p>The only way it works is if I comment out<br /><span class="source-code"><span class="c">//            luminance2 -= 0.12*al*directional_strength;</span></span><br />and leave<br /><span class="source-code">        <span class="k1">if</span> <span class="k2">(</span>luminance2 <span class="k3">&lt;</span> <span class="n">0</span>.<span class="n">0</span><span class="k2">)</span> luminance <span class="k3">=</span> <span class="n">0</span>.<span class="n">0</span><span class="k2">;</span></span><br />as it was.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 29 Jan 2011 00:51:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That weird behaviour reminds me of what might happen when using way too much RAM for the current shader.</p><p>I really don&#39;t have any clue how to solve that weird problem, other than trying to lower the amount of memory used.</p><p>Try lowering these arrays&#39; size:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">float</span> light_x<span class="k2">[</span><span class="n">32</span><span class="k2">]</span><span class="k2">;</span>
<span class="k1">float</span> light_y<span class="k2">[</span><span class="n">32</span><span class="k2">]</span><span class="k2">;</span>
<span class="k1">float</span> light_z<span class="k2">[</span><span class="n">32</span><span class="k2">]</span><span class="k2">;</span>
<span class="k1">float</span> light_r<span class="k2">[</span><span class="n">32</span><span class="k2">]</span><span class="k2">;</span>
<span class="k1">float</span> light_g<span class="k2">[</span><span class="n">32</span><span class="k2">]</span><span class="k2">;</span>
<span class="k1">float</span> light_b<span class="k2">[</span><span class="n">32</span><span class="k2">]</span><span class="k2">;</span>
<span class="k1">float</span> light_range<span class="k2">[</span><span class="n">32</span><span class="k2">]</span><span class="k2">;</span>
</pre></div></div><p>
To 24, or 16.</p><p>And yeah, I couldn&#39;t figure out how to pass float3&#39;s arrays instead. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Sat, 29 Jan 2011 00:56:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sorry, lowering the array size to 16 didn&#39;t help. It still only works if<br /><span class="source-code">            luminance2 <span class="k3">-</span><span class="k3">=</span> <span class="n">0</span>.<span class="n">12</span><span class="k3">*</span>al<span class="k3">*</span>directional_strength<span class="k2">;</span></span><br />is commented out.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Sat, 29 Jan 2011 01:09:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Dario, no new shader code ? Do you give up ??
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Sat, 29 Jan 2011 05:39:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I wouldn&#39;t if that error made sense. <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /> How is it possible that just doing a simple substract operation as that makes the whole shader compiling fail? Even with a set value like 0.12? I&#39;ll try and debug it later on an ATI card instead.</p><p>EDIT: Now that I think about it, it just might be that it&#39;s running out of video memory, and since I forgot to put some checks, it might cause that weird behaviour. As Jones64 said, it was using almost 236 of VRAM, which I could cut down to nearly a third of it by merging some of the maps.</p><p>So I&#39;ll try and code a less expensive version. What utility do you guys use to check out the VRAM usage?</p><p>EDIT: Actually, it could be reduced even more since I didn&#39;t even used a Cache to load the bitmaps. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /> So yeah, I was repeating for all those tiles.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Sun, 30 Jan 2011 01:31:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/900937#target">Dario ff</a> said:</div><div class="quote"><p>What utility do you guys use to check out the VRAM usage?</p></div></div><p>

I used <a href="http://www.techpowerup.com/downloads/SysInfo/GPU-Z/">GPU-Z</a>. It gives me enough info to notice extreme changes to Vmemory usage.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Jones64)</author>
		<pubDate>Mon, 31 Jan 2011 06:21:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So, I&#39;ve ported the (still horrible) shader code to GLSL, so feel free to try the new <a href="http://www.allegro.cc/files/attachment/603272">EXE and shaders</a>(replace the contents of the old folder with this one). It might take a bit longer to load the first time since it has to cook the height map into the normal map the first time. The video ram usage got reduced by half when using a cache, but it didn&#39;t reduce as much as I expect when using the height and normal map in the same texture. I guess the GPU did some compression of its own?</p><p>The main reasons I switched to GLSL:
</p><ul><li><p>CG likes to have the weirdest bugs ever on ATI Hardware(believe me, I tested it on a decent card)
</p></li><li><p>AMD provides a GPU shader analyzer for testing the fragment shader, simulating various cards. And I was astounded by the amount of crap NVidia lets me write with their compiler. It provides support for GLSL, but not CG. (Though HLSL is quite similar, but I&#39;m not sure if it&#39;ll be safe either).</p></li></ul><p>And yes, I got it working finally on an ATI card with this utility. When trying to compile the shader with the X### mobile models in the GPU Shader Analyzer, it just said &quot;Hardware compilation failed&quot;, not detailing anything at all. But it also said the same error with even the most simplest fragment shader ever(Just fetching the color).</p><p>EDIT: Consider the thread title changed to GLSL. <img src="http://www.allegro.cc/forums/smileys/cool.gif" alt="8-)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Mon, 31 Jan 2011 19:30:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I let it run for 10 minutes and all I got was a black screen. ESC didn&#39;t work so I had to call up Task Manager and then I got a window that said Terra-ge.exe had stopped working :<br /><span class="remote-thumbnail"><span class="json">{"name":"603273","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/5\/25ea6bc4f98ae2522cac71ebbe67643e.png","w":503,"h":409,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/5\/25ea6bc4f98ae2522cac71ebbe67643e"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/2/5/25ea6bc4f98ae2522cac71ebbe67643e-240.jpg" alt="603273" width="240" height="195" /></span></p><p>It crashed inside atioglxx.dll for some reason.</p><p>The game log didn&#39;t say much, but maybe you can see how far it got with it :<br /><a href="http://www.allegro.cc/files/attachment/603274">game_log.txt</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 31 Jan 2011 20:27:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Are your drivers up to date?</p><p>EDIT: Or maybe try putting this <a href="http://www.allegro.cc/files/attachment/603275">dll</a> on the game folder?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Mon, 31 Jan 2011 20:37:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/901218#target">Dario ff</a> said:</div><div class="quote"><p>
Or maybe try putting this dll on the game folder?
</p></div></div><p>
That didn&#39;t help. This time, all it did was open a console window with a blinking cursor and did nothing.</p><div class="quote_container"><div class="title">Dario ff said:</div><div class="quote"><p>
Are your drivers up to date?
</p></div></div><p>
I have to download my graphics driver from Gateway. There&#39;s one driver that&#39;s only a few months more recent than the one I have, and there&#39;s another driver that I&#39;m not sure is actually for my laptop, so I&#39;m not going to mess with it. It would take over 10 hours for me to download it anyway.</p><p>If you upload a debugging exe, I&#39;ll run it through gdb for you.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 31 Jan 2011 21:57:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/901211#target">Dario ff</a> said:</div><div class="quote"><p>And I was astounded by the amount of crap NVidia lets me write with their compiler.</p></div></div><p>
IME, that&#39;s true for GLSL as well - Nvidia lets you get away with some pretty awful standards violations.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Mon, 31 Jan 2011 23:08:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>IT WORKS !<br />But I didn&#39;t leave it running enough long to experience what Edgar said.</p><p>One thing: the light spot isn&#39;t moving accordingly to the scroll.</p><p>Ho, and it&#39;s running damn slow, near 20 fps.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Tue, 01 Feb 2011 01:30:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/901249#target">GullRaDriel</a> said:</div><div class="quote"><p>Ho, and it&#39;s running damn slow, near 20 fps.</p></div></div><p>
Mostly because no optimizations are done yet. Heck, it&#39;s even drawing stuff that it&#39;s offscren. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /> And the sprites aren&#39;t resized and are built around a 1920x1080 resolution. First optimization would be loading a lower-res version if the resolution is small(like in laptops). And the second one, resizing them to fit the display well.</p><p>I&#39;m glad it works on Gull&#39;s comp, but Edgar&#39;s problem is beyond my knowledge. <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /> Here&#39;s a <a href="http://www.allegro.cc/files/attachment/603282">debug build</a>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Tue, 01 Feb 2011 01:50:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you&#39;d like me to test on my laptop (GL 2.1, intel 4500MHD on linux), I&#39;d need source, or a linux binary.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 01 Feb 2011 02:01:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/901252#target">Dario ff</a> said:</div><div class="quote"><p>
Here&#39;s a debug build.
</p></div></div><p>

Well, I ran it through gdb, but it didn&#39;t give that much info. When it crashed, the backtrace looked like this :
</p><pre class="terminal">#0  0x02dfa197 in atioglxx!DrvGetProcAddress ()
...
...
...
#1710 0x00410bf9 in TerraGE::Renderer::Render ()
Previous frame inner to this frame (corrupt stack?)</pre><p>
But it didn&#39;t list the line of source code that came from, so it&#39;s probably not too helpful to you, sorry.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 01 Feb 2011 02:47:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Edgar, did you install the latest 10.12 drivers ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Tue, 01 Feb 2011 03:37:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/901280#target">GullRaDriel</a> said:</div><div class="quote"><p>
Edgar, did you install the latest 10.12 drivers ?
</p></div></div><p>

</p><div class="quote_container"><div class="title">Edgar said:</div><div class="quote"><p>
I have to download my graphics driver from Gateway. There&#39;s one driver that&#39;s only a few months more recent than the one I have, and there&#39;s another driver that I&#39;m not sure is actually for my laptop, so I&#39;m not going to mess with it. It would take over 10 hours for me to download it anyway.
</p></div></div><p>
I don&#39;t know if I have a backup driver anywhere, so I don&#39;t want to take the chance that the new driver won&#39;t work for my laptop.</p><p>It&#39;s not that important that the program work on my laptop anyway.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 01 Feb 2011 04:17:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Do you still surf @ 56k ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Tue, 01 Feb 2011 04:38:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Rockin 2.7KB/sec, baby!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 01 Feb 2011 07:40:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s hell of a slow one !! You&#39;re an internet gladiator Ed&#39; ;-)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Tue, 01 Feb 2011 19:15:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I figured out there was something pretty awful going on regarding the normals map and the lighting. But I corrected it, and it looks pretty awesome. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> I have to re-render all the normal maps though. But I better set the proper way to do it now or suffer the consequences later. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /><br /><span class="remote-thumbnail"><span class="json">{"name":"603300","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/2\/f2a0441d4347247ff2506f9007106383.png","w":894,"h":894,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/2\/f2a0441d4347247ff2506f9007106383"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/f/2/f2a0441d4347247ff2506f9007106383-240.jpg" alt="603300" width="240" height="240" /></span><br />(The little block represents the light source)</p><p>It turns out, my older maps were being rendered relative to the screen, and not the local axis of the 3d object. So the vectors of the normal space were in screen coordinates, and using the dot product with the internal light vector didn&#39;t give good results at all. That&#39;s why I just did some hacks to get something similar working.</p><p>Turns out I figured out later how to render the normal maps relative to the local axis, and now it looks pretty sweet. For example:<br /><span class="remote-thumbnail"><span class="json">{"name":"603301","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/1\/f131865e618c25a45fcc6a092139bd26.png","w":973,"h":800,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/1\/f131865e618c25a45fcc6a092139bd26"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/f/1/f131865e618c25a45fcc6a092139bd26-240.jpg" alt="603301" width="240" height="197" /></span><br />Here the normal vectors are mapped correctly. The green channel goes with the Y coordinate, red with X, and blue with Z. Calculating the dot product between the light and the normal vector gave the results seen above(plus adding it to the directional light).</p><p>Just thought of sharing this little problem if someone wants to do something similar. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Fri, 04 Feb 2011 01:55:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That looks way to cool to not be used in a game!! <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (imaxcs)</author>
		<pubDate>Fri, 04 Feb 2011 02:05:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606198/901837#target">imaxcs</a> said:</div><div class="quote"><p>That looks way to cool to not be used in a game</p></div></div><p>
And just imagine how it&#39;ll look with animations! <img src="http://www.allegro.cc/forums/smileys/cool.gif" alt="8-)" /> (Which I&#39;m adding now)</p><p>Here&#39;s some more eye candy now that the normals are right.<br /><span class="remote-thumbnail"><span class="json">{"name":"603308","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/0\/401e6cd9964742666b72163ed3320d14.png","w":923,"h":654,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/0\/401e6cd9964742666b72163ed3320d14"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/4/0/401e6cd9964742666b72163ed3320d14-240.jpg" alt="603308" width="240" height="170" /></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Sat, 05 Feb 2011 05:40:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Looks great. Too bad my machine is so ancient to try it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (kenmasters1976)</author>
		<pubDate>Sun, 06 Feb 2011 00:24:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ah Ken, when will you start saving up for the future? The prices have reduced quite a lot now, you&#39;re missing quite a big chunk of cool stuff with that old rig of yours. <img src="http://www.allegro.cc/forums/smileys/sad.gif" alt=":(" /> Pretty sure you could even trade it in and reduce the price a lot, since some of that hardware isn&#39;t available anymore. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><p>(Though I would keep an old computer just for history&#39;s sake, but...)</p><p>EDIT: Playing around with supporting animated objects now. Of course it&#39;s just a cube for the sake of testing if it works well, but this opens up possibilities for very complex animated characters rendered with per-pixel lighting. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> Here&#39;s a video:<br /><div class="media-player youtube"><div style="margin: 1em 2em; background: url(/images/movie.png); width: 180px; height: 100px; text-align: center;"><a href="http://www.allegro.cc//www.youtube.com/watch?v=g66hvZs8d1k" target="_blank"><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/object/5/f/5f8a5d49fed6f13b9ff55cf20d10f5ce.jpg" border="0" alt="video" title="Click to play video" /></a></div></div></p><p>It&#39;d be awesome if I could get one of these in. <img src="http://www.allegro.cc/forums/smileys/cool.gif" alt="8-)" /><br /><span class="remote-thumbnail"><span class="json">{"name":"baldurs2_screen005.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/d\/8dd7ba4986cb46b5c258498d8c26cde3.jpg","w":640,"h":480,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/d\/8dd7ba4986cb46b5c258498d8c26cde3"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/8/d/8dd7ba4986cb46b5c258498d8c26cde3-240.jpg" alt="baldurs2_screen005.jpg" width="240" height="180" /></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Tue, 08 Feb 2011 02:40:08 +0000</pubDate>
	</item>
</rss>
