<?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"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: declare sampler2D</title>
		<atom:link href="http://cycling74.com/forums/topic/declare-sampler2d/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/declare-sampler2d/feed</link>
		<description></description>
		<pubDate>Mon, 17 Jun 2013 22:08:16 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/declare-sampler2d/#post-44188</guid>
					<title><![CDATA[declare sampler2D]]></title>
					<link>http://cycling74.com/forums/topic/declare-sampler2d/#post-44188</link>
					<pubDate>Mon, 01 Jun 2009 06:50:35 +0000</pubDate>
					<dc:creator>efe</dc:creator>

					<description>
						<![CDATA[
						<p>Hello to everyone:<br />
Hope someone can help me to solve my next question. I am toying with the next shader based on a quartz composer example(attached on this post). I am trying to declare the data type sampler2D in order to use a texture. However, it seems i am doing something wrong. So, my questions are:<br />
1-when I declare my param:</p>
<param name="environment" type="sampler2D" default="0"/>
I am not sure that the type nor the default value are correct as every time I try to compile the shader the post window in Jitter throws the next message:<br />
setting GLSL param: GL Error: Invalid operation<br />
am I missing something here?, how can I declare the sample2D on the params?
<p>2-I was taking a look around the shader folder but it seems that sample2D is never declared as such, is there a correct way to do such declaration?</p>
<p>Thank you very much for the help!<br />
Emmanuel</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/declare-sampler2d/#post-158835</guid>
					<title><![CDATA[Re: declare sampler2D]]></title>
					<link>http://cycling74.com/forums/topic/declare-sampler2d/#post-158835</link>
					<pubDate>Mon, 01 Jun 2009 09:10:41 +0000</pubDate>
					<dc:creator>efe</dc:creator>

					<description>
						<![CDATA[
						<p>Jesus!, so simple!<br />
Sorry for the spam!, it is always good to take a second look!</p>
<param name="environment" type="int" default="0"/>
<p>the heating is making me slow!<br />
Emmanuel</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/declare-sampler2d/#post-158836</guid>
					<title><![CDATA[Re: declare sampler2D]]></title>
					<link>http://cycling74.com/forums/topic/declare-sampler2d/#post-158836</link>
					<pubDate>Mon, 01 Jun 2009 09:36:40 +0000</pubDate>
					<dc:creator>efe</dc:creator>

					<description>
						<![CDATA[
						<p>sorry for all this confusion:<br />
I was trying again and the sampler2D doesn&#8217;t seem to work. Am I doing something wrong?<br />
I am pretty lost now<br />
Emmanuel</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/declare-sampler2d/#post-158837</guid>
					<title><![CDATA[Re: declare sampler2D]]></title>
					<link>http://cycling74.com/forums/topic/declare-sampler2d/#post-158837</link>
					<pubDate>Mon, 01 Jun 2009 18:29:33 +0000</pubDate>
					<dc:creator>pelado</dc:creator>

					<description>
						<![CDATA[
						<p>Just a guess without looking into your patch.  Are you using a rectangular texture? If so look into sampler2DRect or use @rectangular 0 with jit.gl.texture. </p>
<p>pelado</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/declare-sampler2d/#post-158838</guid>
					<title><![CDATA[Re: declare sampler2D]]></title>
					<link>http://cycling74.com/forums/topic/declare-sampler2d/#post-158838</link>
					<pubDate>Mon, 01 Jun 2009 18:44:57 +0000</pubDate>
					<dc:creator>pelado</dc:creator>

					<description>
						<![CDATA[
						<p>I have looked at your patch now and see that you do indeed need to disable the rectangle attribute to the texture object.  But to get it fully working there are a couple of other things to note:</p>
<p>enable @doublebuffer for the window;<br />
and in your shader code refer to the texture coordinates for texture unit0 by using this line in your fragment shader. ie [0] not [1].</p>
<p>	vec2 tex = gl_TexCoord[0].xy;</p>
<p>pelado</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/declare-sampler2d/#post-158839</guid>
					<title><![CDATA[Re: declare sampler2D]]></title>
					<link>http://cycling74.com/forums/topic/declare-sampler2d/#post-158839</link>
					<pubDate>Tue, 02 Jun 2009 00:05:33 +0000</pubDate>
					<dc:creator>efe</dc:creator>

					<description>
						<![CDATA[
						<p>Hello Pelado.<br />
First of all thanks for your answer and taking time to help me.<br />
I just tried as you said and doesn&#8217;t seem to work yet. I cannot figure out what I am missing here. I made a new change to the file, modified the sample2D type on the param declaration to int, so I can avoid having an error saying invalid operator and I enabled the doublebuffer on the window. However, the patch doesn&#8217;t work properly. The texture still is not rendered properly.<br />
What is that I am missing?<br />
I am attaching the new version.<br />
Thank you for your help!<br />
Emmanuel</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/declare-sampler2d/#post-158840</guid>
					<title><![CDATA[Re: declare sampler2D]]></title>
					<link>http://cycling74.com/forums/topic/declare-sampler2d/#post-158840</link>
					<pubDate>Tue, 02 Jun 2009 00:15:07 +0000</pubDate>
					<dc:creator>efe</dc:creator>

					<description>
						<![CDATA[
						<p>Really, long day. Just came back from a concert and my mind is a little bit blurry&#8230;<br />
I managed to fix the shader. As Pelado said the issue was related with the unit number.<br />
A piece of advice: always attach the params to your shader so you can know what is going on!. It seems the default value for the ration was the problem.<br />
Here is a fixed version of the shader!<br />
Thanks again for the help and sorry for the multiple wrong posts on this thread.<br />
Emmanuel</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

