<?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: javascript jit.gl.sketch opengl texture parameters</title>
		<atom:link href="http://cycling74.com/forums/topic/javascript-jit-gl-sketch-opengl-texture-parameters/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/javascript-jit-gl-sketch-opengl-texture-parameters/feed</link>
		<description></description>
		<pubDate>Mon, 17 Jun 2013 22:45:40 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/javascript-jit-gl-sketch-opengl-texture-parameters/#post-24953</guid>
					<title><![CDATA[javascript jit.gl.sketch opengl texture parameters]]></title>
					<link>http://cycling74.com/forums/topic/javascript-jit-gl-sketch-opengl-texture-parameters/#post-24953</link>
					<pubDate>Sun, 19 Mar 2006 02:51:10 +0000</pubDate>
					<dc:creator>pseudostereo</dc:creator>

					<description>
						<![CDATA[
						<p>Hi</p>
<p>I&#8217;m trying to get the various gltexture parameters to work in a Javascript jit.gl.sketch object. Some stuff seems to work, some doesn&#8217;t. </p>
<p>Any help and advice would be appreciated; I&#8217;m not sure that all my syntax is correct. I&#8217;m trying to follow OpenGL commands, but it&#8217;s not always clear how they translate into jitter/javascript/jit.gl.sketch/glcommand-speak; the documentation of this area remains a bit spotty.</p>
<p>//this works:<br />
mySketch.glbindtexture(myImage.texture);</p>
<p>//this works:<br />
mySketch.glenable(&#8220;texture_gen_s&#8221;);<br />
mySketch.glenable(&#8220;texture_gen_t&#8221;);</p>
<p>//this doesn&#8217;t seem to do anything:<br />
mySketch.glenable(&#8220;texture_gen_r&#8221;);</p>
<p>//this reduces texture to 2 x 2 grid, can&#8217;t get anything to affect it:<br />
mySketch.glenable(&#8220;texture_gen_q&#8221;);</p>
<p>//these lines have no effect, texture remains clamped:<br />
mySketch.gltexparameter(&#8220;wrap_s&#8221;,&#8221;repeat&#8221;);<br />
mySketch.gltexparameter(&#8220;wrap_t&#8221;,&#8221;repeat&#8221;);</p>
<p>//this makes the texture negative; however, &#8216;modulate&#8217;, &#8216;decal&#8217; and &#8216;replace&#8217; have no effect:<br />
mySketch.gltexenv(&#8220;mode&#8221;,&#8221;blend&#8221;); </p>
<p>//in this mode, the texture remains a small image in the middle of the object, with edge pixels blurred rest of way (clamped); other settings (such as wrap/repeat) have no effect:<br />
mySketch.gltexgen(&#8220;s&#8221;,&#8221;texture_gen_mode&#8221;,&#8221;object_linear &#8220;);<br />
mySketch.gltexgen(&#8220;t&#8221;,&#8221;texture_gen_mode&#8221;,&#8221;object_linear &#8220;);</p>
<p>//works:<br />
mySketch.gltexgen(&#8220;s&#8221;,&#8221;texture_gen_mode&#8221;,&#8221;sphere_map&#8221;);<br />
mySketch.gltexgen(&#8220;t&#8221;,&#8221;texture_gen_mode&#8221;,&#8221;sphere_map&#8221;);</p>
<p>//exactly the same as &#8216;object linear&#8217;:<br />
mySketch.gltexgen(&#8220;s&#8221;,&#8221;texture_gen_mode&#8221;,&#8221;eye_linear&#8221;);<br />
mySketch.gltexgen(&#8220;t&#8221;,&#8221;texture_gen_mode&#8221;,&#8221;eye_linear&#8221;);</p>
<p>//draw plane:<br />
mySketch.glbegin(&#8220;polygon&#8221;);<br />
mySketch.gltexcoord(1,0,0,1);mySketch.glvertex(-1,-1,0);<br />
mySketch.gltexcoord(0,0,0,1); mySketch.glvertex(1,-1,0);<br />
mySketch.gltexcoord(0,1,0,1); mySketch.glvertex(1,1,0);<br />
mySketch.gltexcoord(1,1,0,1); mySketch.glvertex(-1,1,0);<br />
mySketch.glend();</p>
<p>Running on a 1mHz Powerbook G4 OS X 10.4.5. Latest Max + Jitter.</p>
<p>Also, if there happen to be any additional javascript/jit.gl.sketch/opengl texture commands/parameters that aren&#8217;t documented, I&#8217;d love to know about them.</p>
<p>pH</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/javascript-jit-gl-sketch-opengl-texture-parameters/#post-72844</guid>
					<title><![CDATA[Re: javascript jit.gl.sketch opengl texture parameters]]></title>
					<link>http://cycling74.com/forums/topic/javascript-jit-gl-sketch-opengl-texture-parameters/#post-72844</link>
					<pubDate>Sun, 19 Mar 2006 23:40:34 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>
On Mar 18, 2006, at 6:51 PM, Perry Hoberman wrote:</p>
<p>> //this doesn&#8217;t seem to do anything:<br />
> mySketch.glenable(&#8220;texture_gen_r&#8221;);<br />
><br />
> //this reduces texture to 2 x 2 grid, can&#8217;t get anything to affect it:<br />
> mySketch.glenable(&#8220;texture_gen_q&#8221;);</p>
<p>r and q texture coordinate generation is not currently supported in  <br />
jitter. What do you need them for?</p>
<p>
> //these lines have no effect, texture remains clamped:<br />
> mySketch.gltexparameter(&#8220;wrap_s&#8221;,&#8221;repeat&#8221;);<br />
> mySketch.gltexparameter(&#8220;wrap_t&#8221;,&#8221;repeat&#8221;);</p>
<p>Most likely you are using a rectangular texture which does not  <br />
support the other wrap modes on certain HW/Drivers. Use poer of two  <br />
textures by jit.gl.texture @rectangle 0. This is not a jitter  <br />
limitation.</p>
<p>
> //this makes the texture negative; however, &#8216;modulate&#8217;, &#8216;decal&#8217; and  <br />
> &#8216;replace&#8217; have no effect:<br />
> mySketch.gltexenv(&#8220;mode&#8221;,&#8221;blend&#8221;);</p>
<p>This is for multi-texturing. Please see the RedBook chapters or  <br />
recent mailing list discussions on multitexturing for more info (it  <br />
is somewhat complicated, and out of the scope of our documentation to  <br />
cover). A fix for the combine blend mode is forthcoming. In sketch  <br />
you can provide a second argument for the . Also note you can bind  <br />
shaders with glbindprogram/glunbindprogram(
<programname>), if you  <br />
want to use a shader program for determining texture blending. You  <br />
can also use a shader program to overcome texture clamping  <br />
limitations of rectangular textures FWIW, by doing your own texture  <br />
coordinate math in the shader to wrap within the unclamped range.</programname></p>
<p>See archives for an example of shader use from within sketch.</p>
<p>
> //in this mode, the texture remains a small image in the middle of  <br />
> the object, with edge pixels blurred rest of way (clamped); other  <br />
> settings (such as wrap/repeat) have no effect:<br />
> mySketch.gltexgen(&#8220;s&#8221;,&#8221;texture_gen_mode&#8221;,&#8221;object_linear &#8220;);<br />
> mySketch.gltexgen(&#8220;t&#8221;,&#8221;texture_gen_mode&#8221;,&#8221;object_linear &#8220;);</p>
<p>This is to be expected if the texture type does not support repeat  <br />
wrap modes. Note that you can zoom in/out using the texture matrix  <br />
transform (glmatrixmode).</p>
<p>Hope this helps. For the most part everything in sketch just maps  <br />
clearly to the documentation from the Red Book, provided that you  <br />
understand HW/Driver limitations.</p>
<p>-Joshua</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

