<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Point Lights</title>
	<atom:link href="http://www.catalinzima.com/tutorials/deferred-rendering-in-xna/point-lights/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.catalinzima.com</link>
	<description>XNA Tutorials, Samples and Thoughts</description>
	<lastBuildDate>Wed, 01 Feb 2012 17:36:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: Hubert</title>
		<link>http://www.catalinzima.com/tutorials/deferred-rendering-in-xna/point-lights/comment-page-1/#comment-34732</link>
		<dc:creator>Hubert</dc:creator>
		<pubDate>Sun, 22 May 2011 09:42:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.catalinzima.com/?page_id=55#comment-34732</guid>
		<description>Actually checking the distance of light from camera and setting different culling modes based on that is not needed. You can set back face culling and it should just work, lighting every pixel exactly once for convex closed shape like sphere - more details on this page: http://www.beyond3d.com/content/articles/19/6</description>
		<content:encoded><![CDATA[<p>Actually checking the distance of light from camera and setting different culling modes based on that is not needed. You can set back face culling and it should just work, lighting every pixel exactly once for convex closed shape like sphere &#8211; more details on this page: <a href="http://www.beyond3d.com/content/articles/19/6" rel="nofollow">http://www.beyond3d.com/content/articles/19/6</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 62316e</title>
		<link>http://www.catalinzima.com/tutorials/deferred-rendering-in-xna/point-lights/comment-page-1/#comment-30856</link>
		<dc:creator>62316e</dc:creator>
		<pubDate>Mon, 16 Aug 2010 18:10:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.catalinzima.com/?page_id=55#comment-30856</guid>
		<description>There is my problem with point light.
http://img829.imageshack.us/img829/6086/pointlight.png

Directional light is disabled.</description>
		<content:encoded><![CDATA[<p>There is my problem with point light.<br />
<a href="http://img829.imageshack.us/img829/6086/pointlight.png" rel="nofollow">http://img829.imageshack.us/img829/6086/pointlight.png</a></p>
<p>Directional light is disabled.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 62316e</title>
		<link>http://www.catalinzima.com/tutorials/deferred-rendering-in-xna/point-lights/comment-page-1/#comment-30853</link>
		<dc:creator>62316e</dc:creator>
		<pubDate>Mon, 16 Aug 2010 16:34:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.catalinzima.com/?page_id=55#comment-30853</guid>
		<description>My point light is rendered as Half Sphere. What i did wrong?</description>
		<content:encoded><![CDATA[<p>My point light is rendered as Half Sphere. What i did wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Building Blocks of Deferred Rendering</title>
		<link>http://www.catalinzima.com/tutorials/deferred-rendering-in-xna/point-lights/comment-page-1/#comment-29508</link>
		<dc:creator>The Building Blocks of Deferred Rendering</dc:creator>
		<pubDate>Sun, 13 Jun 2010 18:26:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.catalinzima.com/?page_id=55#comment-29508</guid>
		<description>[...] We can extract the x/y/z world coordinates of any given pixel from the depth map, for further information on achieving this visit this page. [...]</description>
		<content:encoded><![CDATA[<p>[...] We can extract the x/y/z world coordinates of any given pixel from the depth map, for further information on achieving this visit this page. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.catalinzima.com/tutorials/deferred-rendering-in-xna/point-lights/comment-page-1/#comment-27813</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Tue, 30 Mar 2010 19:21:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.catalinzima.com/?page_id=55#comment-27813</guid>
		<description>Hey,

Great tutorial, thanks alot for the effort! :-)

Just a hint for anyone having problems with the point lights not showing. I had to disable depth write for the directional full screen pass. Otherwise, the spheres won&#039;t get rendered.

So in DrawDirectionalLight() do this :

GraphicsDevice.RenderState.DepthBufferWriteEnable = false;
quadRenderer.Render(Vector2.One * -1, Vector2.One);
GraphicsDevice.RenderState.DepthBufferWriteEnable = true;</description>
		<content:encoded><![CDATA[<p>Hey,</p>
<p>Great tutorial, thanks alot for the effort! <img src='http://www.catalinzima.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Just a hint for anyone having problems with the point lights not showing. I had to disable depth write for the directional full screen pass. Otherwise, the spheres won&#8217;t get rendered.</p>
<p>So in DrawDirectionalLight() do this :</p>
<p>GraphicsDevice.RenderState.DepthBufferWriteEnable = false;<br />
quadRenderer.Render(Vector2.One * -1, Vector2.One);<br />
GraphicsDevice.RenderState.DepthBufferWriteEnable = true;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: csisy</title>
		<link>http://www.catalinzima.com/tutorials/deferred-rendering-in-xna/point-lights/comment-page-1/#comment-27608</link>
		<dc:creator>csisy</dc:creator>
		<pubDate>Sun, 21 Mar 2010 10:00:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.catalinzima.com/?page_id=55#comment-27608</guid>
		<description>Hi,

Thanks for this article, very cool! :)

I&#039;ve some problem with point lights:
- if the camera is &quot;inside&quot; the sphere&#039;s triangle (== camera eye position intersect sphere triangle), i can&#039;t see anything. What can i do?
- Here is an image: http://yscik.com/jf/pfs.php?m=view&amp;v=2044-screenshot_5.jpg
The 4th square from left is the light render target&#039;s texture. The final image isn&#039;t as contrast as the light RT&#039;s texture. Why?
I cheated a little: in final combine effect, i do this:

float3 diffuse = tex2D(colorSampler, In.TexCoord).rgb;
float3 light   = tex2D(lightSampler, In.TexCoord).rgb * 2;
	
return float4(saturate(diffuse * light), 1.0f);

PS: Sorry for my bad english</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanks for this article, very cool! <img src='http://www.catalinzima.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I&#8217;ve some problem with point lights:<br />
- if the camera is &#8220;inside&#8221; the sphere&#8217;s triangle (== camera eye position intersect sphere triangle), i can&#8217;t see anything. What can i do?<br />
- Here is an image: <a href="http://yscik.com/jf/pfs.php?m=view&#038;v=2044-screenshot_5.jpg" rel="nofollow">http://yscik.com/jf/pfs.php?m=view&#038;v=2044-screenshot_5.jpg</a><br />
The 4th square from left is the light render target&#8217;s texture. The final image isn&#8217;t as contrast as the light RT&#8217;s texture. Why?<br />
I cheated a little: in final combine effect, i do this:</p>
<p>float3 diffuse = tex2D(colorSampler, In.TexCoord).rgb;<br />
float3 light   = tex2D(lightSampler, In.TexCoord).rgb * 2;</p>
<p>return float4(saturate(diffuse * light), 1.0f);</p>
<p>PS: Sorry for my bad english</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JinJin</title>
		<link>http://www.catalinzima.com/tutorials/deferred-rendering-in-xna/point-lights/comment-page-1/#comment-27303</link>
		<dc:creator>JinJin</dc:creator>
		<pubDate>Tue, 09 Mar 2010 11:34:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.catalinzima.com/?page_id=55#comment-27303</guid>
		<description>Hi

For anyone who experiences horizontal lines or similar strange artifacts, this solution I &quot;found&quot; on http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html (well, not exactly) worked on my GeForce 6600GT:

private float cameraDistance = 70;

projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, aspectRatio, 10, 100);

Thanks for the great tutorial!</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>For anyone who experiences horizontal lines or similar strange artifacts, this solution I &#8220;found&#8221; on <a href="http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html" rel="nofollow">http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html</a> (well, not exactly) worked on my GeForce 6600GT:</p>
<p>private float cameraDistance = 70;</p>
<p>projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, aspectRatio, 10, 100);</p>
<p>Thanks for the great tutorial!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: czaurel</title>
		<link>http://www.catalinzima.com/tutorials/deferred-rendering-in-xna/point-lights/comment-page-1/#comment-25217</link>
		<dc:creator>czaurel</dc:creator>
		<pubDate>Wed, 02 Dec 2009 21:45:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.catalinzima.com/?page_id=55#comment-25217</guid>
		<description>In reply to Lucas:

I found that this problem (or at least my problem, which was utterly similar) was related to parts of the sphere model rendering with wrong culling.
This can be solved if you test the camera position against the light radius taking the near plane distance into account. This is because the rendering &quot;starts&quot; from the near plane, not from the actual camera position.
So the code for determining the cull mode should be something like this:

if (cameraToCenter &lt; lightRadius + camera.NearDistance)
 GraphicsDevice.RenderState.CullMode = CullMode.CullClockwiseFace;
else
 GraphicsDevice.RenderState.CullMode = CullMode.CullCounterClockwiseFace;</description>
		<content:encoded><![CDATA[<p>In reply to Lucas:</p>
<p>I found that this problem (or at least my problem, which was utterly similar) was related to parts of the sphere model rendering with wrong culling.<br />
This can be solved if you test the camera position against the light radius taking the near plane distance into account. This is because the rendering &#8220;starts&#8221; from the near plane, not from the actual camera position.<br />
So the code for determining the cull mode should be something like this:</p>
<p>if (cameraToCenter &lt; lightRadius + camera.NearDistance)<br />
 GraphicsDevice.RenderState.CullMode = CullMode.CullClockwiseFace;<br />
else<br />
 GraphicsDevice.RenderState.CullMode = CullMode.CullCounterClockwiseFace;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Meds</title>
		<link>http://www.catalinzima.com/tutorials/deferred-rendering-in-xna/point-lights/comment-page-1/#comment-23021</link>
		<dc:creator>Meds</dc:creator>
		<pubDate>Wed, 12 Aug 2009 08:34:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.catalinzima.com/?page_id=55#comment-23021</guid>
		<description>Hi Catalin,

First of all I must say that you&#039;ve done a terrific job with these tutorials!

I&#039;m slowly porting the XNA code to unmanaged C++ DirectX, so far I&#039;ve gotten as far as implementing point lights (here).

The reason I&#039;m porting it is to learn as I code however I&#039;m sort of stuck.

Where you calculate the position in world space:

//compute screen-space position    float4 position;    position.xy = input.ScreenPosition.xy;    position.z = depthVal;    position.w = 1.0f;    //transform to world space    position = mul(position, InvertViewProjection);    position /= position.w;


The position created does not seem to be what I think. My assumption is that here you&#039;re getting the position at the point in world space as the comment syas. However if I simply output position (that is, avoid all lighting calculations) right after the position is calculated (after position /= position.w;) I do: return position;

The colours returned do not match up with what I&#039;d expect of if it was a position map because I thought a position map would essentially replace each pixels colour with the colour of its position in terms of r, g, b where r is x, g is y and b is z. However the colours output keep changing based on both the cameras position and cameras orientation.

So I was wondering why this is and also was wondering if there was a way to get a position map as I&#039;ve described :)

Again, I really like your tutorial! Has helped me more than any other deffered rendering tutorial on the internet!</description>
		<content:encoded><![CDATA[<p>Hi Catalin,</p>
<p>First of all I must say that you&#8217;ve done a terrific job with these tutorials!</p>
<p>I&#8217;m slowly porting the XNA code to unmanaged C++ DirectX, so far I&#8217;ve gotten as far as implementing point lights (here).</p>
<p>The reason I&#8217;m porting it is to learn as I code however I&#8217;m sort of stuck.</p>
<p>Where you calculate the position in world space:</p>
<p>//compute screen-space position    float4 position;    position.xy = input.ScreenPosition.xy;    position.z = depthVal;    position.w = 1.0f;    //transform to world space    position = mul(position, InvertViewProjection);    position /= position.w;</p>
<p>The position created does not seem to be what I think. My assumption is that here you&#8217;re getting the position at the point in world space as the comment syas. However if I simply output position (that is, avoid all lighting calculations) right after the position is calculated (after position /= position.w;) I do: return position;</p>
<p>The colours returned do not match up with what I&#8217;d expect of if it was a position map because I thought a position map would essentially replace each pixels colour with the colour of its position in terms of r, g, b where r is x, g is y and b is z. However the colours output keep changing based on both the cameras position and cameras orientation.</p>
<p>So I was wondering why this is and also was wondering if there was a way to get a position map as I&#8217;ve described <img src='http://www.catalinzima.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Again, I really like your tutorial! Has helped me more than any other deffered rendering tutorial on the internet!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://www.catalinzima.com/tutorials/deferred-rendering-in-xna/point-lights/comment-page-1/#comment-22528</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Wed, 22 Jul 2009 20:04:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.catalinzima.com/?page_id=55#comment-22528</guid>
		<description>Hey,
this is a great tutorial, and like many others I&#039;ve been trying to convert it to DirectX, DirectX9 in specific. Although I&#039;ve hit a problem with the point light. When I try to render a point light, I get this:

http://img212.imageshack.us/img212/2303/screenshot3n.png

This is my C++ code
http://pastebin.com/f4becf3ae

and this is how I call it
DeferredPointLight(D3DXVECTOR3(0.0f, 2.0f, 0.0f), vColour3, 10.0f, 2.0f, pBackBuffer)

I&#039;m really lost, thanks =]</description>
		<content:encoded><![CDATA[<p>Hey,<br />
this is a great tutorial, and like many others I&#8217;ve been trying to convert it to DirectX, DirectX9 in specific. Although I&#8217;ve hit a problem with the point light. When I try to render a point light, I get this:</p>
<p><a href="http://img212.imageshack.us/img212/2303/screenshot3n.png" rel="nofollow">http://img212.imageshack.us/img212/2303/screenshot3n.png</a></p>
<p>This is my C++ code<br />
<a href="http://pastebin.com/f4becf3ae" rel="nofollow">http://pastebin.com/f4becf3ae</a></p>
<p>and this is how I call it<br />
DeferredPointLight(D3DXVECTOR3(0.0f, 2.0f, 0.0f), vColour3, 10.0f, 2.0f, pBackBuffer)</p>
<p>I&#8217;m really lost, thanks =]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

