<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>http://forums.xna.com/forums/50.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>Re: HLSL distance function</title><link>http://forums.xna.com/forums/thread/210779.aspx</link><pubDate>Fri, 07 Aug 2009 18:34:56 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:210779</guid><dc:creator>Dean</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/210779.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=50&amp;PostID=210779</wfw:commentRss><description>Not sure if you are still having issues. But from the looks of your code you are expecting the distance function to return a float3 when it only returns a float for the distance. &lt;a href="http://msdn.microsoft.com/en-us/library/bb509592(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/bb509592(VS.85).aspx&lt;/a&gt;&lt;br /&gt;</description></item><item><title>HLSL distance function</title><link>http://forums.xna.com/forums/thread/193818.aspx</link><pubDate>Fri, 26 Jun 2009 20:59:17 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:193818</guid><dc:creator>mghoffmann</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/193818.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=50&amp;PostID=193818</wfw:commentRss><description>&lt;p&gt;Hi, I&amp;#39;m a long time reader, first time poster in these forums so please forgive me if this post is in the wrong section.&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;ve been having a problem with the HLSL distance function in my pixel shader.&lt;br /&gt;
&lt;br /&gt;
Here is my code:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="background-color:white;font-size:16px;color:#000000;"&gt;float3 Dist = distance(LightSource.xyz, In.AimDirection.xyz);&lt;/span&gt; &lt;br /&gt;
And here&amp;#39;s my exception message: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="background-color:white;font-size:16px;color:#000000;"&gt;Error&amp;nbsp;1&amp;nbsp;Errors compiling C:\Users\Public\Michael&amp;#39;s Projects\XNA\Game\Game\Content\SkyBox.fx:&lt;br /&gt;
C:\Users\Public\Michael&amp;#39;s Projects\XNA\Game\Game\Content\SkyBox.fx(35): warning X4707: texcoord inputs used directly (that is, other than sampling from textures) in shader body in ps_1_1 are always clamped from 0 to 1&lt;br /&gt;
C:\Users\Public\Michael&amp;#39;s Projects\XNA\Game\Game\Content\SkyBox.fx(35): error X4532: cannot map expression to pixel shader instruction set&lt;br /&gt;
C:\Users\Public\Michael&amp;#39;s Projects\XNA\Game\Game\Content\SkyBox.fx(46): ID3DXEffectCompiler::CompileEffect: There was an error compiling expression&lt;br /&gt;
ID3DXEffectCompiler: Compilation failed&amp;nbsp;C:\Users\Public\Michael&amp;#39;s Projects\XNA\Game\Game\Content\SkyBox.fx&amp;nbsp;35&amp;nbsp;1&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I have no idea what that whole texcoord stuff is about...&lt;br /&gt;
Thanks in advance for any help.&lt;br /&gt;
&lt;br /&gt;
--Michael &lt;/p&gt;</description></item></channel></rss>