<?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>verbaska.com</title>
	<atom:link href="http://verbaska.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://verbaska.com</link>
	<description>Developer&#039;s blog and portfolio</description>
	<lastBuildDate>Fri, 27 Aug 2010 14:06:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Learning how to move an object in XNA</title>
		<link>http://verbaska.com/?p=383</link>
		<comments>http://verbaska.com/?p=383#comments</comments>
		<pubDate>Fri, 27 Aug 2010 14:06:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Game programming]]></category>

		<guid isPermaLink="false">http://verbaska.com/?p=383</guid>
		<description><![CDATA[Today we are going to use the Update method. Is is based on the previous tutorial. Go to this method, and type this.pos.X++; This will add 1 to the X coordinate of the position. Run the game. You can see that the image is moving. Download the source code here]]></description>
			<content:encoded><![CDATA[<p>Today we are going to use the <strong>Update </strong>method. Is is based on the <a href="http://verbaska.com/?p=353" target="_blank">previous tutorial</a>.</p>
<p>Go to this method, and type <strong>this.pos.X++;</strong></p>
<p>This will add 1 to the X coordinate of the position. Run the game. You can see that the image is moving.</p>
<p><a title="HLSL" href="http://verbaska.com/files/moveImage.zip">Download the source code here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://verbaska.com/?feed=rss2&amp;p=383</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blender tips #1</title>
		<link>http://verbaska.com/?p=371</link>
		<comments>http://verbaska.com/?p=371#comments</comments>
		<pubDate>Wed, 25 Aug 2010 13:49:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blender]]></category>

		<guid isPermaLink="false">http://verbaska.com/?p=371</guid>
		<description><![CDATA[1. Smooth and flat shading The mesh can bee smooth or flat. The smooth one looks more realistic. In order to activate on of these modes, go to the left panel (Object tools), select the object and activate a mode by pressing on the suitable button. 2. Making normals consistent Sometimes, when you work in [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1. Smooth and flat shading</strong></p>
<p>The mesh can bee smooth or flat. The smooth one looks more realistic.</p>
<p>In order to activate on of these modes, go to the left panel (Object  tools), select the object and activate a mode by pressing on the  suitable button.</p>
<p><img title="Flat shading" src="http://verbaska.com/images/shading_1.jpg" alt="" width="500" height="230" /></p>
<p><img title="Smooth shading" src="http://verbaska.com/images/shading_2.jpg" alt="" width="500" height="230" /></p>
<p><strong>2. Making normals consistent</strong></p>
<p>Sometimes, when you work in the solid mode, everything seems to be ok. However, when you switch to textured mode, you can see that your model has some terrible holes!</p>
<p>Or when you smooth your model, you get something like that:</p>
<p><img class="alignnone" title="Recalculating normals" src="http://verbaska.com/images/norm_1.jpg" alt="" width="500" height="230" /></p>
<p>To fix it, activate the &#8216;edit mode&#8217; by selecting the object and pressing the &#8216;tab&#8217; key on your keyboard. Now press &#8216;A&#8217; to select all and then press &#8216;ctrl+N&#8217;.</p>
<p><img class="alignnone" title="Recalculating normals" src="http://verbaska.com/images/norm_2.jpg" alt="" width="500" height="230" /></p>
]]></content:encoded>
			<wfw:commentRss>http://verbaska.com/?feed=rss2&amp;p=371</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blender tutorials</title>
		<link>http://verbaska.com/?p=366</link>
		<comments>http://verbaska.com/?p=366#comments</comments>
		<pubDate>Wed, 25 Aug 2010 12:43:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://verbaska.com/?p=366</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://verbaska.com/?feed=rss2&amp;p=366</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XNA game programming tutorials</title>
		<link>http://verbaska.com/?p=363</link>
		<comments>http://verbaska.com/?p=363#comments</comments>
		<pubDate>Wed, 25 Aug 2010 12:26:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://verbaska.com/?p=363</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://verbaska.com/?feed=rss2&amp;p=363</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drawing an image in XNA</title>
		<link>http://verbaska.com/?p=353</link>
		<comments>http://verbaska.com/?p=353#comments</comments>
		<pubDate>Sat, 21 Aug 2010 16:22:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Game programming]]></category>

		<guid isPermaLink="false">http://verbaska.com/?p=353</guid>
		<description><![CDATA[Today we are going to draw our first image in XNA. At first, let&#8217;s add an object that will represent the image. Its type is Texture2D, it means that you can draw the image on the screen as it is or to apply it on a 3D model. Type this line before the constructor method [...]]]></description>
			<content:encoded><![CDATA[<p>Today we are going to draw our first image in XNA.</p>
<p>At first, let&#8217;s add an object that will represent the image. Its type is <strong>Texture2D,</strong> it means that you can draw the image on the screen as it is or to apply it on a 3D model.</p>
<p>Type this line before the constructor method (<strong>public Game1()</strong>)<br />
<strong>Texture2D texture;</strong></p>
<p><strong>And this line:<br />
Vector2 pos;</strong><br />
It will just store the position of the image.</p>
<p>Now it&#8217;s the time to load it from the computer. Take an image, go to Visual Studio, right click on <strong>Content </strong>in the right window, then <strong>Add &#8211; Existing item&#8230; </strong>and add your file.<strong> </strong></p>
<p>In the <strong>LoadContent()</strong> method, load it:<br />
<strong>texture = Content.Load&lt;Texture2D&gt;(&#8220;</strong>your file name with quotation marks<strong>&#8220;);</strong></p>
<p>It&#8217;s a little bit tricky, in order to load an image you can&#8217;t create an instance of Texture2D. You must use the <strong>Content</strong> property of the <strong>Game </strong>class (the base of <strong>Game1</strong>).</p>
<p>And declare the position:<br />
<strong>pos = Vector2.Zero;</strong><br />
<em><strong>Vector2.Zero</strong></em> &#8211; will return a (0,0) coordinate. It actually does the same as<strong> new Vector2(0,0)</strong>.</p>
<p>Go to the <strong>Draw(GameTime gameTime)</strong> method.</p>
<p>In order to draw an image, you must declare a sprite batch first. Then to draw the image and after that, to end the sprite batch. Write these lines in this method:</p>
<p><strong>spriteBatch.Begin();</p>
<p>spriteBatch.Draw(texture, pos, Color.White);</p>
<p>spriteBatch.End();</strong></p>
<p>Here we see that<strong> </strong><strong>spriteBatch.Draw </strong>will draw our image.<strong> </strong>Here we see a simple method overloading of<strong> Draw</strong>, it gets our texture, the position and a filtering color, where &#8216;white&#8217; means that our color filter won&#8217;t add color to the image.<br />
<a href="http://img541.imageshack.us/img541/9014/imagedk.png"><img class="alignnone" title="XNA image" src="http://img541.imageshack.us/img541/9014/imagedk.png" alt="XNA image" width="308" height="242" /></a></p>
<p><a title="HLSL" href="http://verbaska.com/files/showingImage.zip">Download the source code here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://verbaska.com/?feed=rss2&amp;p=353</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Overview of XNA default project template</title>
		<link>http://verbaska.com/?p=309</link>
		<comments>http://verbaska.com/?p=309#comments</comments>
		<pubDate>Mon, 16 Aug 2010 13:20:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Game programming]]></category>

		<guid isPermaLink="false">http://verbaska.com/?p=309</guid>
		<description><![CDATA[When you create a new XNA project, you notice that there is a lot of a pre-written code. It means that someone has already done the hard work for you. Let&#8217;s have a look. This template is optimized for a 2D game. We have these data members: graphics and spriteBatch. graphics - handles the configuration [...]]]></description>
			<content:encoded><![CDATA[<p>When you create a new XNA project, you notice that there is a lot of a pre-written code. It means that someone has already done the hard work for you.</p>
<p>Let&#8217;s have a look.</p>
<p>This template is optimized for a 2D game. We have these data members: <strong>graphics </strong>and <strong>spriteBatch</strong>.</p>
<p><strong>graphics </strong>- handles the configuration and management of the graphics device</p>
<p><strong>spriteBatch</strong> &#8211; allows you to draw a 2d image on the screen. But it can&#8217;t draw *.gif and vector formats.</p>
<p>We have this method <strong>public Game1()<br />
</strong>It constructs our game class. There is no need to edit it now.<strong></strong></p>
<p><strong>protected override void Initialize()<br />
</strong>Here you initialize the non-graphic content. <strong></strong></p>
<p><strong>protected override void LoadContent()</strong><br />
When the game starts, it activates this method. Here you load your content. For example create instances, load images e.t.c.</p>
<p><strong>protected override void UnloadContent()</strong><br />
The place to unload your content. Usually, there is no need to do that.</p>
<p><strong>protected override void Update(GameTime gameTime)</strong><br />
This method is being called 60 times a second. Here you update the coordinates of the objects, handle input, check for collisions e.t.c.</p>
<p><strong>gameTime</strong> &#8211; contains the game time data (game time in seconds, milliseconds, hours e.t.c.).</p>
<p><em>if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)<br />
this.Exit();</em></p>
<p>Feel free to remove this code from the method if you don&#8217;t make a XBOX 360 game.<em><br />
</em></p>
<p><strong>protected override void Draw(GameTime gameTime)</strong><br />
The most interesting method. Here you draw the 2d images or 3d primitives.</p>
<p>In the next tutorials I&#8217;m going to talk about these two methods <strong>Update </strong>and <strong>Draw</strong>.</p>
<p>See you later!</p>
]]></content:encoded>
			<wfw:commentRss>http://verbaska.com/?feed=rss2&amp;p=309</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XNA and HLSL tutorial #3</title>
		<link>http://verbaska.com/?p=297</link>
		<comments>http://verbaska.com/?p=297#comments</comments>
		<pubDate>Mon, 09 Aug 2010 13:43:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Game programming]]></category>

		<guid isPermaLink="false">http://verbaska.com/?p=297</guid>
		<description><![CDATA[This tutorial is based on the first one. Today we are going to make our effects more impressive and dynamic, by getting info from the game itself. To add a variable, go to the .fx effect file and type, for example, float factor; after the sampler2D sourceColor; Now we will multiply each coordinate indent (blur [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial is based on <a href="http://verbaska.com/?p=274">the first one</a>.</p>
<p>Today we are going to make our effects more impressive and dynamic, by getting info from the game itself.<br />
To add a variable, go to the .fx effect file and type, for example,<strong> float factor; </strong>after the<strong> sampler2D sourceColor;</strong></p>
<p>Now we will multiply each coordinate indent (blur effect) by this factor.</p>
<p><strong>color += tex2D( sourceColor, coord.xy + 0.01f * factor);<br />
color += tex2D( sourceColor, coord.xy + 0.02f * factor);<br />
color += tex2D( sourceColor, coord.xy + 0.03f * factor);<br />
color += tex2D( sourceColor, coord.xy + 0.04f * factor);</strong></p>
<p>Now try to run the game. If you see the XNA logo without any effects, it means that everything is okay.  In HLSL like in C# float has a default value of zero. It means that if you do not set a value to the float and use it somewhere, it acts like a zero.</p>
<p>Go to the game class (in our case Game1), to the <strong>Update </strong>method. We access the effect here. Now type this line:</p>
<p><strong>effect.Parameters["factor"].SetValue((float)Math.Cos(gameTime.TotalRealTime.Milliseconds*10)/5);</strong></p>
<p>Hard to understand?<strong> </strong>Let me explain it.<strong><br />
</strong>As you can see, here we access the effect parameter that we have added (called <strong>factor</strong>). Then we set its value to the cosine result of our game&#8217;s length, and multiply all this stuff by numbers that will make the animation look smoother.</p>
<p>In general, the indent value of the pixel is being multiplied by a figure-of-eight curve.</p>
<p><a title="HLSL" href="http://developer.verbaska.com/HLSL1_animated.zip">Download the source code here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://verbaska.com/?feed=rss2&amp;p=297</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XNA and HLSL tutorial #2</title>
		<link>http://verbaska.com/?p=280</link>
		<comments>http://verbaska.com/?p=280#comments</comments>
		<pubDate>Mon, 26 Jul 2010 15:18:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Game programming]]></category>

		<guid isPermaLink="false">http://verbaska.com/?p=280</guid>
		<description><![CDATA[Let&#8217;s see what we can do more with the pixel shader. This will be our template, here the pixel shader takes the pixel color and draws it on the screen. See how to use this code in the previous chapter. sampler2D sourceColor; float4 BlurShader( float2 coord : TEXCOORD0 ) : COLOR0 { float4 color; color [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s see what we can do more with the pixel shader.</p>
<p>This will be our template, here the pixel shader takes the pixel color and draws it on the screen. See how to use this code in the <a title="XNA and HLSL" href="http://verbaska.com/?p=274" target="_blank">previous chapter</a>.</p>
<table style="height: 483px;" border="0" cellspacing="0" cellpadding="1" width="513">
<tbody>
<tr valign="top">
<td style="padding-left: 30px;" width="200" height="100" bgcolor="#efefef">
<p style="padding-left: 30px;">
<p>sampler2D sourceColor;</p>
<p>float4 BlurShader( float2 coord : TEXCOORD0 ) : COLOR0<br />
{</p>
<p>float4 color;</p>
<p>color = tex2D( sourceColor, coord.xy);</p>
<p>//do manipulations here</p>
<p>return color;</p>
<p>}</p>
<p>technique Blur<br />
{</p>
<p>pass one<br />
{</p>
<p>PixelShader = compile ps_2_0 BlurShader();</p>
<p>}</p>
<p>}</td>
</tr>
</tbody>
</table>
<p>And this photo will be our base.</p>
<p><img class="alignnone" title="Base photo for HLSL" src="http://img341.imageshack.us/img341/4907/44199681.jpg" alt="" width="500" height="375" /></p>
<p>Multiplying the color data by 2, will make the picture look brighter:<br />
Write this line before &#8220;<strong>return color;</strong>&#8220;:<br />
<strong>color *= 2;</strong></p>
<p><img class="alignnone" title="XNA and HLSL" src="http://img709.imageshack.us/img709/5450/54215710.jpg" alt="" width="500" height="375" /></p>
<p>The color data is contained from red, green and blue colors data. Each color data ranged from 0 to 1. It&#8217;s very important to know. Here you can see how to access the channel data of the color. Each color has the following parameters:</p>
<p><strong>color.r = </strong>the red channel<strong><br />
</strong><strong>color.g</strong> = the green channel<br />
<strong>color.b =</strong> the blue channel<strong><br />
</strong><strong>color.a </strong>= the alpha channel</p>
<p>And combinations, like:</p>
<p><strong>color.rgb = </strong>red, green and blue<strong><br />
</strong><strong>color.rg = </strong>red and green<strong><br />
</strong></p>
<p>And so on.</p>
<p>Here we divide the red channel value by 2:</p>
<p><strong>color.r /= 2;</strong></p>
<p><img class="alignnone" title="XNA and HLSL" src="http://img248.imageshack.us/img248/9812/80761030.jpg" alt="" width="500" height="375" /></p>
<p>Put this code after &#8220;<strong>float4 color;</strong>&#8220;:</p>
<p><strong>coord.y = coord.y  + (sin(coord.y*100)*0.02); </strong></p>
<p><img class="alignnone" title="XNA and HLSL" src="http://img256.imageshack.us/img256/1092/25143752.jpg" alt="" width="500" height="375" /></p>
<p>Wow, a water effect!</p>
<p>Even more:</p>
<p><strong>color.rgb = (color.r+color.g+color.b)/3.0f;</strong></p>
<p><img class="alignnone" title="XNA and HLSL" src="http://img830.imageshack.us/img830/1077/93141916.jpg" alt="" width="500" height="375" /></p>
]]></content:encoded>
			<wfw:commentRss>http://verbaska.com/?feed=rss2&amp;p=280</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XNA and HLSL tutorial #1</title>
		<link>http://verbaska.com/?p=274</link>
		<comments>http://verbaska.com/?p=274#comments</comments>
		<pubDate>Thu, 15 Jul 2010 13:59:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Game programming]]></category>

		<guid isPermaLink="false">http://verbaska.com/?p=274</guid>
		<description><![CDATA[Today we are going to try adding some effects to our game. Here we will test a pixel shader. The idea of a pixel shader is just to return the color of a pixel on the screen. For example: sampler2D sourceColor; float4 BlurShader( float2 coord : TEXCOORD0 ) : COLOR0 { float4 color; color = [...]]]></description>
			<content:encoded><![CDATA[<p>Today we are going to try adding some effects to our game.</p>
<p>Here we will test a pixel shader. The idea of a pixel shader is just to return the color of a pixel on the screen.</p>
<p>For example:</p>
<table style="height: 574px;" border="0" cellspacing="0" cellpadding="1" width="513">
<tbody>
<tr valign="top">
<td style="padding-left: 30px;" width="200" height="100" bgcolor="#efefef">
<p style="padding-left: 30px;">
<p style="padding-left: 30px;">
<p>sampler2D sourceColor;</p>
<p style="padding-left: 30px;">
<p>float4 BlurShader( float2 coord : TEXCOORD0 ) : COLOR0<br />
{</p>
<p style="padding-left: 30px;">float4 color;</p>
<p style="padding-left: 30px;">color = tex2D( sourceColor, coord.xy);<br />
color += tex2D( sourceColor, coord.xy + 0.001f);<br />
color += tex2D( sourceColor, coord.xy + 0.002f);<br />
color += tex2D( sourceColor, coord.xy + 0.003f);<br />
color += tex2D( sourceColor, coord.xy + 0.004f);<br />
color /= 5;</p>
<p style="padding-left: 30px;">return color;</p>
<p>}</p>
<p>technique Blur<br />
{</p>
<p style="padding-left: 30px;">pass one<br />
{</p>
<p>PixelShader = compile ps_2_0 BlurShader();</p>
<p>}</p>
<p>}</td>
</tr>
</tbody>
</table>
<p style="text-align: left;"><span style="color: #888888;"><br />
</span></p>
<p><span style="color: #888888;">Here the shader blurs the picture. Let&#8217;s see how does it blur.</span></p>
<p><span style="color: #000000;"><span style="color: #888888;"><strong>technique blur</strong> &#8211; the techinque we are using now.<br />
<strong>BlurShader</strong> &#8211; our main code.<br />
<strong>float4</strong> &#8211; stores 4 floats (red, green, blue and alpha). It&#8217;s going to be our color.</span></span><br />
<span style="color: #888888;"><strong>sampler2D sourceColor</strong> &#8211; the current pixel. (The shader runs over all of th<span style="color: #888888;">e pixels in the given image)</span></span><span style="color: #888888;">.</span></p>
<p><span style="color: #888888;"><strong>color = tex2D( sourceColor, coord.xy);</strong> &#8211; sets the work color to the color of the current pixel.<br />
<strong>color += tex2D( sourceColor, coord.xy + 0.001f); </strong>- adds the the work color a color of a nearby pixel<br />
<strong>color /= 5;</strong> &#8211; here we need to reduce the brightness of the color by dividing its values by the quantity of the taken pixels.</span></p>
<p><span style="color: #888888;">Now we need to put it in the XNA code.</span></p>
<p><span style="color: #888888;"><br />
</span></p>
<p><span style="color: #888888;">Create an effect:</span></p>
<p><span style="color: #888888;"> </span><strong>Effect effect;</strong></p>
<p>Load it:</p>
<p>effect =Content.Load&lt;Effect&gt;(&#8220;effect&#8221;);</p>
<p><strong>Add it to the draw method:</strong></p>
<p>spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate, SaveStateMode.SaveState);<br />
effect.Begin();<br />
EffectPass pass = effect.CurrentTechnique.Passes[0];<br />
pass.Begin();</p>
<p>spriteBatch.Draw(logo, new Vector2(100,150), Color.White);</p>
<p>pass.End();<br />
effect.End();<br />
spriteBatch.End();</p>
<p>Note that the sort mode must be set to immediate! Otherwise, it won&#8217;t work.</p>
<p><strong>The result:</strong></p>
<p><strong><img class="alignnone" title="Result of HLSL shader" src="http://img204.imageshack.us/img204/2052/resultn.png" alt="" width="508" height="210" /></strong></p>
<p><strong><a href="http://developer.verbaska.com/HLSL1.zip">Download the source code</a><br />
</strong></p>
<p><span style="color: #808080;"> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://verbaska.com/?feed=rss2&amp;p=274</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Photoshop tutorials</title>
		<link>http://verbaska.com/?p=270</link>
		<comments>http://verbaska.com/?p=270#comments</comments>
		<pubDate>Thu, 15 Jul 2010 13:25:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://verbaska.com/?p=270</guid>
		<description><![CDATA[High quality tutorials. Reveal the top Photoshop&#8217;s secrets.]]></description>
			<content:encoded><![CDATA[<p>High quality tutorials. Reveal the top Photoshop&#8217;s secrets.</p>
]]></content:encoded>
			<wfw:commentRss>http://verbaska.com/?feed=rss2&amp;p=270</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
