<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>OpenGL Discussion and Help Forums - OpenGL coding: beginners</title>
		<link>http://www.opengl.org/discussion_boards/</link>
		<description>If you are just beginning to code with OpenGL, post your questions here</description>
		<language>en</language>
		<lastBuildDate>Mon, 20 May 2013 00:48:01 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.opengl.org/discussion_boards/images/misc/rss.png</url>
			<title>OpenGL Discussion and Help Forums - OpenGL coding: beginners</title>
			<link>http://www.opengl.org/discussion_boards/</link>
		</image>
		<item>
			<title>ogldev atspace co uk tutorial</title>
			<link>http://www.opengl.org/discussion_boards/showthread.php/181733-ogldev-atspace-co-uk-tutorial?goto=newpost</link>
			<pubDate>Sun, 19 May 2013 18:15:08 GMT</pubDate>
			<description><![CDATA[Hi. Please, help me with the following problem. I'm trying to follow tutorial12 from the site in title, but I use glfw instead of glut and glm...]]></description>
			<content:encoded><![CDATA[<div>Hi. Please, help me with the following problem. I'm trying to follow tutorial12 from the site in title, but I use glfw instead of glut and glm instead of creating all matrix classes myself. It was fine until tutorial 12, now instead of rotating pyramid I get some garbage on screen, because matrix multiplication using glm provides different result than using hand written library from this tutorial. What can be the problem? How can I fix this? I really would like to use glm instead of just copy pasting everything from this tutorial as it is easier to understand how stuff works this way.</div>

]]></content:encoded>
			<category domain="http://www.opengl.org/discussion_boards/forumdisplay.php/6-OpenGL-coding-beginners">OpenGL coding: beginners</category>
			<dc:creator>vania z</dc:creator>
			<guid isPermaLink="true">http://www.opengl.org/discussion_boards/showthread.php/181733-ogldev-atspace-co-uk-tutorial</guid>
		</item>
		<item>
			<title>Contouring in OpenGL</title>
			<link>http://www.opengl.org/discussion_boards/showthread.php/181732-Contouring-in-OpenGL?goto=newpost</link>
			<pubDate>Sun, 19 May 2013 14:47:01 GMT</pubDate>
			<description>Hi, 
 
I Need to display contours for a given grid. The grid what I have is triangulated. I also have an algorithm for generating contours for a...</description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
I Need to display contours for a given grid. The grid what I have is triangulated. I also have an algorithm for generating contours for a given range. Now one option is to use this generated contour values to display the contour lines using VBOs. I want to know whether there is more easier way to do the same using  opengl shaders? I guess it is possible after reading this <a href="http://www.opengl.org/discussion_boards/showthread.php/159800-Contour-algorithm" target="_blank">thread</a>. I didn't completely understand that. Is it that algorithm what I have written should be written in the shader itself?<br />
<br />
Please guide me.<br />
<br />
Thanks<br />
<br />
Regards<br />
Rakesh Patil</div>

]]></content:encoded>
			<category domain="http://www.opengl.org/discussion_boards/forumdisplay.php/6-OpenGL-coding-beginners">OpenGL coding: beginners</category>
			<dc:creator>rakeshthp</dc:creator>
			<guid isPermaLink="true">http://www.opengl.org/discussion_boards/showthread.php/181732-Contouring-in-OpenGL</guid>
		</item>
		<item>
			<title>Lighting Problem</title>
			<link>http://www.opengl.org/discussion_boards/showthread.php/181730-Lighting-Problem?goto=newpost</link>
			<pubDate>Sun, 19 May 2013 05:34:45 GMT</pubDate>
			<description><![CDATA[EDIT: I fixed it with a few hours of google searching. If anyone could delete/lock the thread that'd be great :) (I hadn't declared a specific...]]></description>
			<content:encoded><![CDATA[<div>EDIT: I fixed it with a few hours of google searching. If anyone could delete/lock the thread that'd be great :) (I hadn't declared a specific material for those also wondering)<br />
<br />
Hello fellow programmers! A couple of months ago I decided that I wanted to learn OpenGl. Finally, I decided to bite the bullet and learn it! Now, I am coding with GLUT and GLEW, but I still felt this would be an appropriate forum to post on, as they ( to my knowledge ) simplify some of the functions. Anyway, to the problem! I just now started fumbling with lighting, and I picked up a very strange problem. The objects seem to be lit fine, but there is a large completely black spot on them. ( both spheres ) Screenshot, and code included below.<br />
<br />
 - Warning: Please excuse the extreme sloppiness as, this is merely a test of knowledge, not an attempt to write neat code. So it's kinda all over the place. My apologies :p -<br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">#include &lt;GL/glew.h&gt;
#include &lt;GL/glut.h&gt;
#include &lt;cmath&gt;
&nbsp;
float locx = 0.0f;
float locy = 0.0f;
float sinAdd = 0.0f;
&nbsp;
float planx = 0.0f;
float plany = 0.0f;
&nbsp;
void Reshape( int width, int height )
{
&nbsp;
    glViewport( 0, 0, (GLsizei)width, (GLsizei)height );
    glMatrixMode( GL_PROJECTION );
&nbsp;
    glLoadIdentity();
    gluPerspective( 90, (GLfloat)width / (GLfloat)height, 1.0, 100.0 );
&nbsp;
    glMatrixMode( GL_MODELVIEW );
&nbsp;
}
&nbsp;
void lightInit( void )
{
&nbsp;
    GLfloat matSpecular&#91;&#93; = { 1.0, 1.0, 1.0, 1.0 };
    GLfloat matShininess&#91;&#93; = { 50.0 };
    GLfloat lightPos&#91;&#93; = { 0.0, -2.0, -5.0, 0.0 };
&nbsp;
    glShadeModel( GL_SMOOTH );
&nbsp;
    glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, matSpecular );
    glMaterialfv( GL_FRONT_AND_BACK, GL_SHININESS, matShininess );
    glLightfv( GL_LIGHT0, GL_POSITION, lightPos );
&nbsp;
    glEnable( GL_LIGHTING );
    glEnable( GL_LIGHT0 );
&nbsp;
}
&nbsp;
void drawPlanet( void )
{
&nbsp;
    locx = ( sin( sinAdd )*3 ) + planx;
    locy = ( cos( sinAdd )*3 ) + plany;
&nbsp;
    glPushMatrix();
&nbsp;
    glTranslatef( locx, 0.0f, locy );
    glutSolidSphere( 0.2, 64, 64 );
&nbsp;
    glPopMatrix();
&nbsp;
    sinAdd+= 0.0001f;
&nbsp;
}
&nbsp;
void drawSun( void )
{
&nbsp;
    planx = sin( sinAdd );
    plany = cos( sinAdd );
&nbsp;
    glPushMatrix();
&nbsp;
    glPushAttrib( GL_CURRENT_BIT );
&nbsp;
    glColor3f( 0.3f, 0.0f, 0.0f );
    glTranslatef( 0.0f, 0.0f, 0.0f );
    glutSolidSphere( 0.7, 16, 16 );
&nbsp;
    glPopAttrib();
&nbsp;
    glPopMatrix();
&nbsp;
}
&nbsp;
void Display( void )
{
&nbsp;
    glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
&nbsp;
    glLoadIdentity();
&nbsp;
    glTranslatef( 0.0f, -2.0f, -10.0f );
    drawPlanet();
    drawSun();
    //drawMoon();
&nbsp;
    glutSwapBuffers();
&nbsp;
}
&nbsp;
int main( int argc, char **argv )
{
&nbsp;
    glutInit( &amp;argc, argv );
    glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH );
    glEnable( GL_DEPTH );
&nbsp;
    glEnable( GL_COLOR_MATERIAL );
&nbsp;
    glutInitWindowSize( 1024, 900 );
    glutInitWindowPosition( 200, 100 );
&nbsp;
    glutCreateWindow( &quot;Orbital Sim&quot; );
&nbsp;
    lightInit();
&nbsp;
    glutDisplayFunc( Display );
    glutIdleFunc( Display );
    glutReshapeFunc( Reshape );
&nbsp;
    glutMainLoop();
&nbsp;
}</pre></div></code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.opengl.org/discussion_boards/forumdisplay.php/6-OpenGL-coding-beginners">OpenGL coding: beginners</category>
			<dc:creator>DavidBittner</dc:creator>
			<guid isPermaLink="true">http://www.opengl.org/discussion_boards/showthread.php/181730-Lighting-Problem</guid>
		</item>
		<item>
			<title><![CDATA[Invalid qualifiers 'in' in global variable]]></title>
			<link>http://www.opengl.org/discussion_boards/showthread.php/181729-Invalid-qualifiers-in-in-global-variable?goto=newpost</link>
			<pubDate>Sat, 18 May 2013 22:40:11 GMT</pubDate>
			<description><![CDATA[Hi, i'm trying to compile a simple vertex shader, but I keep getting this error:  
"ERROR: 0:2: Invalid qualifiers 'in' in global variable context"....]]></description>
			<content:encoded><![CDATA[<div>Hi, i'm trying to compile a simple vertex shader, but I keep getting this error: <br />
&quot;ERROR: 0:2: Invalid qualifiers 'in' in global variable context&quot;.<br />
<br />
Here is the code it's refering to:<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">const char* vertexSource =
&quot;#version 120\n&quot;
&quot;in vec2 position;&quot;
&quot;void main() {&quot;
&quot;	gl_Position = vec4( position, 0.0, 1.0 );&quot;
&quot;}&quot;;</pre></div></code><hr />
</div><br />
What am i doing wrong?</div>

]]></content:encoded>
			<category domain="http://www.opengl.org/discussion_boards/forumdisplay.php/6-OpenGL-coding-beginners">OpenGL coding: beginners</category>
			<dc:creator>troels_y</dc:creator>
			<guid isPermaLink="true">http://www.opengl.org/discussion_boards/showthread.php/181729-Invalid-qualifiers-in-in-global-variable</guid>
		</item>
		<item>
			<title>Translation towards the camera.</title>
			<link>http://www.opengl.org/discussion_boards/showthread.php/181726-Translation-towards-the-camera?goto=newpost</link>
			<pubDate>Fri, 17 May 2013 22:15:44 GMT</pubDate>
			<description>I probably already have a solution to the math behind moving the scene towards the camera, but it stops rendering when translated much at all and...</description>
			<content:encoded><![CDATA[<div>I probably already have a solution to the math behind moving the scene towards the camera, but it stops rendering when translated much at all and never seems to get closer to the camera even when it is translating. When I was going with making the area larger in scale to make it look like one is zooming in, the clipping wasn't as much of a problem and the range was much greater, so I am extremely confused. I have tried changing glOrtho(0,640,0,WHEIGHT,-1000,1000); to glOrtho(0,640,0,WHEIGHT,-32768,32768); and other things, but the problem remains. How should I go about editing the limits so that I can translate it closer to the camera without it disappearing? Thanks!</div>

]]></content:encoded>
			<category domain="http://www.opengl.org/discussion_boards/forumdisplay.php/6-OpenGL-coding-beginners">OpenGL coding: beginners</category>
			<dc:creator>Flotonic</dc:creator>
			<guid isPermaLink="true">http://www.opengl.org/discussion_boards/showthread.php/181726-Translation-towards-the-camera</guid>
		</item>
		<item>
			<title>Unity developer GLSL BEGINNER</title>
			<link>http://www.opengl.org/discussion_boards/showthread.php/181722-Unity-developer-GLSL-BEGINNER?goto=newpost</link>
			<pubDate>Fri, 17 May 2013 16:29:36 GMT</pubDate>
			<description><![CDATA[Hey Guys, 
 
I'm trying to learn GLSL but i'm getting stucked with a lot of basic matrix transformations and gl_ properties . Did you have some nice...]]></description>
			<content:encoded><![CDATA[<div>Hey Guys,<br />
<br />
I'm trying to learn GLSL but i'm getting stucked with a lot of basic matrix transformations and gl_ properties . Did you have some nice book to recommend ? I was looking for that OpenGL Shading Language orange book but i have no sure if that one will be to advanced for a GLSL beginner . <br />
<br />
Thanks for your help guys ,<br />
<br />
Cheers</div>

]]></content:encoded>
			<category domain="http://www.opengl.org/discussion_boards/forumdisplay.php/6-OpenGL-coding-beginners">OpenGL coding: beginners</category>
			<dc:creator>pedrogarlaschi</dc:creator>
			<guid isPermaLink="true">http://www.opengl.org/discussion_boards/showthread.php/181722-Unity-developer-GLSL-BEGINNER</guid>
		</item>
		<item>
			<title>FBO / Context resize</title>
			<link>http://www.opengl.org/discussion_boards/showthread.php/181720-FBO-Context-resize?goto=newpost</link>
			<pubDate>Fri, 17 May 2013 08:40:37 GMT</pubDate>
			<description>Hi,  
 
 I use 2 FBO to realize AR with OpenCV. So I do my rendering stuff, and call glReadPixels to load in my cv::Mat.   
   -The first is to warp...</description>
			<content:encoded><![CDATA[<div>Hi, <br />
<br />
 I use 2 FBO to realize AR with OpenCV. So I do my rendering stuff, and call glReadPixels to load in my cv::Mat.  <br />
   -The first is to warp some textures and work well. The size here is fixed depending on my statistic training model. <br />
   -The second is to apply transformations on a model. The size here change for every frame depending on my ROI on the image. <br />
<br />
 Here is my problem : The 2nd FBO always have the same size as the first. I know it because when i read the buffer... Well it's not good. But when I read the buffer in a matrix of the size of the first FBO it's OK. <br />
<br />
I use win7x64 with VS2010, an OpenCV window <br />
Here is the code to switch the fbo :<br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;
void ARContext(){
&nbsp;
	resizeWindow(&quot;GL&quot;, roi.width, roi.height);
&nbsp;
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
&nbsp;
&nbsp;
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	perspectiveGL( 47.0, roi.width/roi.height, 0.01, 100.0 );
&nbsp;
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();	
	glViewport(0, 0, roi.width, roi.height);
&nbsp;
	glBindTexture(GL_TEXTURE_2D, poseTexID);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, roi.width, roi.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
	glBindTexture(GL_TEXTURE_2D, 0);
&nbsp;
	glBindRenderbuffer(GL_RENDERBUFFER, poseDBufferID);
	glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, roi.width, roi.height);
	glBindRenderbuffer(GL_RENDERBUFFER, 0);
&nbsp;
	glBindFramebuffer(GL_FRAMEBUFFER, 0);
	glBindFramebuffer(GL_FRAMEBUFFER, poseFBO);
&nbsp;
	glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, poseTexID, 0);
	glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, poseDBufferID);
&nbsp;
	errorCheck(&quot;AR Context&quot;);
}
&nbsp;
void WarpContext(){
&nbsp;
	resizeWindow(&quot;GL&quot;, model-&gt;getROI().width, model-&gt;getROI().height);
&nbsp;
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
&nbsp;
	glBindFramebuffer(GL_FRAMEBUFFER, 0);
	glBindFramebuffer(GL_FRAMEBUFFER, *warpFBOID);
&nbsp;
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glOrtho(0, model-&gt;getROI().width, 0, model-&gt;getROI().height, -5.0, 5.0);
&nbsp;
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	glViewport(0, 0, model-&gt;getROI().width, model-&gt;getROI().height);
&nbsp;
	errorCheck(&quot;Warp Context&quot;);
}</pre></div></code><hr />
</div><br />
I don't have any opengl error... Is there some trick to resize a context ?<br />
<br />
EDIT :: <br />
Oh ok. It's noted.<br />
<br />
The FBO1 always have a smaller size, but it's also 32bit floating point data on 1 channel (GL_R32F).<br />
FBO2 is 4Channels usigned bytes (GL_RGBA).  I don't copy from one to another FBO.<br />
<br />
here is a screenshot : <br />
<a href="http://www.opengl.org/discussion_boards/attachment.php?attachmentid=1028&amp;d=1368786171" id="attachment1028" rel="Lightbox_0" ><img src="http://www.opengl.org/discussion_boards/attachment.php?attachmentid=1028&amp;d=1368785847&amp;thumb=1" border="0" alt="Click image for larger version.&nbsp;

Name:	AR.jpg&nbsp;
Views:	36&nbsp;
Size:	18.9 KB&nbsp;
ID:	1028" class="thumbnail" style="float:CONFIG" /></a><br />
<br />
For the moment I only draw a red rectangle and not my 3D model. <br />
Here is the code to draw and read : <br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;
void AAMFitter::drawModel(){
&nbsp;
	glLoadIdentity();
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
&nbsp;
	glTranslatef(0.0f, 0.0f, -3.0f);
&nbsp;
	glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
&nbsp;
	glBegin(GL_QUADS);
		glVertex3f(-1.0f, 1.0f, 0.0f);
		glVertex3f(1.0f, 1.0f, 0.0f);
		glVertex3f(1.0f, -1.0f, 0.0f);
		glVertex3f(-1.0f, -1.0f, 0.0f);
	glEnd();
&nbsp;
}
&nbsp;
void AAMFitter::ARStuff(Mat&amp; source){
&nbsp;
	ARContext();
&nbsp;
	Mat ip(pIndex.size(), 1, CV_32FC2, Scalar::all(0.0));
&nbsp;
	for(int i = 0; i &lt; pIndex.size(); i++){
		ip.at&lt;Vec2f&gt;(i) = Vec2f(shape-&gt;at(2*pIndex&#91;i&#93;), shape-&gt;at(2*pIndex&#91;i&#93;+1));
	}
&nbsp;
	solvePose(ip);
&nbsp;
	drawModel();
&nbsp;
	Mat image(roi.height, roi.width, CV_8UC4, Scalar::all(0));
&nbsp;
	glReadPixels(0, 0, image.cols, image.rows, GL_BGRA, GL_UNSIGNED_BYTE, image.ptr());
&nbsp;
	namedWindow(&quot;ARout&quot;);
	imshow(&quot;ARout&quot;, image);
	waitKey();
&nbsp;
	WarpContext();
}</pre></div></code><hr />
</div><br />
If I read the buffer in a matrix of the FBO1's size I have a square.<br />
<br />
<a href="http://www.opengl.org/discussion_boards/attachment.php?attachmentid=1029&amp;d=1368786815" id="attachment1029" rel="Lightbox_0" ><img src="http://www.opengl.org/discussion_boards/attachment.php?attachmentid=1029&amp;d=1368786815&amp;thumb=1" border="0" alt="Click image for larger version.&nbsp;

Name:	AR.jpg&nbsp;
Views:	41&nbsp;
Size:	16.7 KB&nbsp;
ID:	1029" class="thumbnail" style="float:CONFIG" /></a><br />
<br />
The square is red, and I don't have any data type error. So the FBO is changed or I would have some weird things. <br />
The GL_BGRA is because of OpenCV storing data in BGRA.</div>


	<div style="padding:10px">

	
		<fieldset class="fieldset">
			<legend>Attached Thumbnails</legend>
			<div style="padding:10px">
			
<a href="http://www.opengl.org/discussion_boards/attachment.php?attachmentid=1028&amp;d=1368786171" 
rel="Lightbox_1250882" id="attachment1028"
><img class="thumbnail" src="http://www.opengl.org/discussion_boards/attachment.php?attachmentid=1028&amp;stc=1&amp;thumb=1&amp;d=1368785847" 
alt="Click image for larger version.&nbsp;

Name:	AR.jpg&nbsp;
Views:	N/A&nbsp;
Size:	18.9 KB&nbsp;
ID:	1028"/></a>
&nbsp;

<a href="http://www.opengl.org/discussion_boards/attachment.php?attachmentid=1029&amp;d=1368786815" 
rel="Lightbox_1250882" id="attachment1029"
><img class="thumbnail" src="http://www.opengl.org/discussion_boards/attachment.php?attachmentid=1029&amp;stc=1&amp;thumb=1&amp;d=1368786815" 
alt="Click image for larger version.&nbsp;

Name:	AR.jpg&nbsp;
Views:	N/A&nbsp;
Size:	16.7 KB&nbsp;
ID:	1029"/></a>
&nbsp;

			</div>
		</fieldset>
	

	

	

	

	</div>
]]></content:encoded>
			<category domain="http://www.opengl.org/discussion_boards/forumdisplay.php/6-OpenGL-coding-beginners">OpenGL coding: beginners</category>
			<dc:creator>Rogeeeer</dc:creator>
			<guid isPermaLink="true">http://www.opengl.org/discussion_boards/showthread.php/181720-FBO-Context-resize</guid>
		</item>
		<item>
			<title>drawing text and primitives at the same time</title>
			<link>http://www.opengl.org/discussion_boards/showthread.php/181715-drawing-text-and-primitives-at-the-same-time?goto=newpost</link>
			<pubDate>Thu, 16 May 2013 18:09:11 GMT</pubDate>
			<description><![CDATA[I am writing simple GUI library for OpenGL. There are lot's of tutorials how to render text, and even more about primitives. Currenly I am...]]></description>
			<content:encoded><![CDATA[<div>I am writing simple GUI library for OpenGL. There are lot's of tutorials how to render text, and even more about primitives. Currenly I am experimenting on this tutorial But problem is I cannot figure out how to render both of them at the same time. For example how to draw square and some text on it. What I managed to do is draw both of them but then shader colored them in same color..<br />
<br />
Can someone point me to the right direction?</div>

]]></content:encoded>
			<category domain="http://www.opengl.org/discussion_boards/forumdisplay.php/6-OpenGL-coding-beginners">OpenGL coding: beginners</category>
			<dc:creator>insanebits</dc:creator>
			<guid isPermaLink="true">http://www.opengl.org/discussion_boards/showthread.php/181715-drawing-text-and-primitives-at-the-same-time</guid>
		</item>
		<item>
			<title>Does opengl help in the display of an existing image</title>
			<link>http://www.opengl.org/discussion_boards/showthread.php/181714-Does-opengl-help-in-the-display-of-an-existing-image?goto=newpost</link>
			<pubDate>Thu, 16 May 2013 17:22:46 GMT</pubDate>
			<description><![CDATA[I need to repeatedly display an image--say, one frame from a video stream--on a monitor at 120hz. I think this is an issue of vsync. I'm wondering...]]></description>
			<content:encoded><![CDATA[<div>I need to repeatedly display an image--say, one frame from a video stream--on a monitor at 120hz. I think this is an issue of vsync. I'm wondering whether opengl can help to display an existing image or it can only draw animations and display them. If possible, could someone show me some codes as an example ? Thanks.</div>

]]></content:encoded>
			<category domain="http://www.opengl.org/discussion_boards/forumdisplay.php/6-OpenGL-coding-beginners">OpenGL coding: beginners</category>
			<dc:creator>sheny35</dc:creator>
			<guid isPermaLink="true">http://www.opengl.org/discussion_boards/showthread.php/181714-Does-opengl-help-in-the-display-of-an-existing-image</guid>
		</item>
		<item>
			<title>glVertexAttribP4uiv</title>
			<link>http://www.opengl.org/discussion_boards/showthread.php/181710-glVertexAttribP4uiv?goto=newpost</link>
			<pubDate>Thu, 16 May 2013 09:57:35 GMT</pubDate>
			<description><![CDATA[i have been trying to use glVertexAttribP with GL_UNSIGNED_INT_2_10_10_10_REV but stuck up at some point. 
 
here is my code 
 
<div...]]></description>
			<content:encoded><![CDATA[<div>i have been trying to use glVertexAttribP with GL_UNSIGNED_INT_2_10_10_10_REV but stuck up at some point.<br />
<br />
here is my code<br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">GLuint red=0,green=511,blue=511,alpha=3;
	GLuint val = 0;
&nbsp;
	val = val | (alpha &lt;&lt; 30);
	val = val | (blue &lt;&lt; 20);
	val = val | (green &lt;&lt; 10);
	val = val | (red &lt;&lt; 0);
	GLfloat vertices&#91;&#93;={-0.9f, -0.9f, 0.0f,1.0f,
						 -0.9f, 0.6f, 0.0f,1.0f,
						 0.6f,0.6f,0.0f,1.0f,
						 0.6f,-0.9f,0.0f,1.0f};
&nbsp;
&nbsp;
	GLuint test_data&#91;&#93;={val,val,val,val};
	glGenBuffers(1, &amp;BufferId);
	glBindBuffer(GL_ARRAY_BUFFER, BufferId);
	glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
&nbsp;
	glEnableVertexAttribArray(glGetAttribLocation(shader_data.psId,&quot;position&quot;));
	glVertexAttribPointer(glGetAttribLocation(shader_data.psId,&quot;position&quot;), 4,GL_FLOAT,GL_FALSE, 0,0);
&nbsp;
&nbsp;
	glGenBuffers(1, &amp;BufferId1);
	glBindBuffer(GL_ARRAY_BUFFER, BufferId1);
	glBufferData(GL_ARRAY_BUFFER, sizeof(test_data), test_data, GL_STATIC_DRAW);
&nbsp;
	glEnableVertexAttribArray(glGetAttribLocation(shader_data.psId,&quot;color&quot;));
//	glVertexAttribPointer(glGetAttribLocation(shader_data.psId,&quot;color&quot;), 4,GL_INT_2_10_10_10_REV,GL_TRUE, 0,0);
      glVertexAttribP4uiv(glGetAttribLocation(shader_data.psId,&quot;color&quot;),GL_UNSIGNED_INT_2_10_10_10_REV ,GL_TRUE,0);
&nbsp;
&nbsp;
	glDrawArrays(GL_TRIANGLE_FAN,0,4);</pre></div></code><hr />
</div><br />
it gives Access violation at glDraw call. code works fine with glVertexAttribPointer. what am i missing here?</div>

]]></content:encoded>
			<category domain="http://www.opengl.org/discussion_boards/forumdisplay.php/6-OpenGL-coding-beginners">OpenGL coding: beginners</category>
			<dc:creator>debonair</dc:creator>
			<guid isPermaLink="true">http://www.opengl.org/discussion_boards/showthread.php/181710-glVertexAttribP4uiv</guid>
		</item>
		<item>
			<title><![CDATA[[OGL 3.3] MSAA and black textures]]></title>
			<link>http://www.opengl.org/discussion_boards/showthread.php/181709-OGL-3-3-MSAA-and-black-textures?goto=newpost</link>
			<pubDate>Thu, 16 May 2013 09:41:01 GMT</pubDate>
			<description>If I have turned off MSAA, then textures are displayed correctly. When I turn on MSAA, textures (bmp and dds) are black, but objects without bound...</description>
			<content:encoded><![CDATA[<div>If I have turned off MSAA, then textures are displayed correctly. When I turn on MSAA, textures (bmp and dds) are black, but objects without bound textures have correct colors.<br />
So shortly:<br />
1) MSAA off -&gt; everything is displayed correctly<br />
2) MSAA on -&gt; not textured objects are displayed correctly, textured objects are black.<br />
<br />
How to fix this problem?<br />
<br />
Codes:<br />
Window and antialiasing initiation:<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">bool TCore::SetDCPixelFormat(HDC hDC_1) //ustawienie formatu pikseli
{
	PIXELFORMATDESCRIPTOR pfd;
&nbsp;
	memset(&amp;pfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
&nbsp;
	pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
	pfd.nVersion = 1;
	pfd.dwFlags = PFD_DOUBLEBUFFER | PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW;
	pfd.iPixelType = PFD_TYPE_RGBA;
	pfd.cColorBits = 24;
	pfd.cAlphaBits = 8; 
	pfd.cDepthBits = 24;
	pfd.cStencilBits = 8;
	pfd.iLayerType = PFD_MAIN_PLANE;
&nbsp;
	int PixelFormat = ChoosePixelFormat(hDC_1, &amp;pfd);
&nbsp;
	if(PixelFormat == 0)
	{
		ERROR_H.Error_Log(&quot;ChoosePixelFormat failed!&quot;, false);
		return false;
	}
&nbsp;
	if(SetPixelFormat(APP.hDC, OGL_WNDW.MSAAPixelFormat == 0 ? PixelFormat : OGL_WNDW.MSAAPixelFormat, &amp;pfd) == false)
	{
		ERROR_H.Error_Log(&quot;SetPixelFormat failed!&quot;, false);
		return false;
	}
&nbsp;
	return true;
}
//--------------------------------------------------------------------
&nbsp;
bool TCore::InitGlew(void) //inicjacja rozszerze&#324; glew
{
if(glewInit() != GLEW_OK)
{
	ERROR_H.Error_Log(&quot;glewInit failed!&quot;, false);
	return false;
}
&nbsp;
if (!glewIsSupported(
	&quot;GL_VERSION_3_3 &quot;
	&quot;GL_ARB_vertex_program &quot;
	&quot;GL_ARB_fragment_program &quot;
	)) {
&nbsp;
	ERROR_H.Error_Log(&quot;Unable to load extensions\n\nExiting...\n&quot;, false);
	return false;
}
&nbsp;
return true;
};
//---------------------------------------------------------------------
&nbsp;
bool TCore::InitwGlew(void) //inicjacja rozszerze&#324; wglew
{
if (!wglewIsSupported(
	&quot;WGLEW_ARB_pixel_format &quot;
	&quot;WGLEW_EXT_swap_control &quot;
	&quot;WGLEW_ARB_create_context &quot;
	)) {
&nbsp;
	//ERROR_H.Error_Log(&quot;Unable to load wglew extensions\n\nExiting...\n&quot;, false);
	//return false;
}
&nbsp;
return true;
};
//---------------------------------------------------------------------
&nbsp;
bool TCore::Make_Antialiasing(void)
{
if (OGL_WNDW.MSAA_On == true) { //MSAA - od 2x do 24x
	if(OGL_WNDW.MSAAPixelFormat == 0 &amp;&amp; OGL_WNDW.MSAA_Samples &gt; 0)
	{
		if(WGLEW_ARB_pixel_format &amp;&amp; GLEW_ARB_multisample)
		{
			while(OGL_WNDW.MSAA_Samples &gt; 0)
			{
				UINT NumFormats = 0;
&nbsp;
				int PFAttribs&#91;&#93; =
				{
					WGL_DRAW_TO_WINDOW_ARB, GL_TRUE,
					WGL_SUPPORT_OPENGL_ARB, GL_TRUE,
					WGL_DOUBLE_BUFFER_ARB, GL_TRUE,
					WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB,
					WGL_COLOR_BITS_ARB, 24,
					WGL_ALPHA_BITS_ARB, 8,
					WGL_DEPTH_BITS_ARB, 24,
					WGL_STENCIL_BITS_ARB, 8,
					WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB,
					WGL_SAMPLE_BUFFERS_ARB, 1, //GL_TRUE,
					WGL_SAMPLES_ARB, OGL_WNDW.MSAA_Samples,
					0
				};
&nbsp;
				bool result = wglChoosePixelFormatARB(APP.hDC, PFAttribs, NULL, 1, &amp;OGL_WNDW.MSAAPixelFormat, &amp;NumFormats);
&nbsp;
				if(result == true &amp;&amp; NumFormats &gt; 0) {
					break;
				}
&nbsp;
				OGL_WNDW.MSAA_Samples--;
			}
&nbsp;
			wglDeleteContext(OGL_WNDW.hGLRC);
			DestroyWindow(APP.hWnd);
			UnregisterClass(//here forum doesn't let post code);
&nbsp;
			return InitApplication();
		}
		else
		{
			OGL_WNDW.MSAA_Samples = 0;
			ERROR_H.Error_Log(&quot;Unable to load extensions: WGLEW_ARB_pixel_format or GLEW_ARB_multisample&quot;, false);
		}
	}
	else {
		//ERROR_H.Error_Log(&quot;OGL_WNDW.MSAAPixelFormat (=&quot; + FloatToStr(OGL_WNDW.MSAAPixelFormat) + &quot;) or OGL_WNDW.MSAA_Samples (=&quot; + FloatToStr(OGL_WNDW.MSAA_Samples) + &quot;) is incorrect&quot;, false);
    }
}
&nbsp;
return true;
};
//---------------------------------------------------------------------
&nbsp;
bool TCore::Create_OpenGL(void)
{
APP.hDC = GetDC(APP.hWnd);
&nbsp;
if(APP.hDC == NULL){
	ERROR_H.Error_Log(&quot;GetDC failed!&quot;, false);
	return false;
}
&nbsp;
if (SetDCPixelFormat(APP.hDC) == false) {
	return false;
}
&nbsp;
OGL_WNDW.hGLRC = wglCreateContext(APP.hDC);
&nbsp;
if(OGL_WNDW.hGLRC == NULL)
{
	ERROR_H.Error_Log(&quot;wglCreateContext failed!&quot;, false);
	return false;
}
&nbsp;
if(wglMakeCurrent(APP.hDC, OGL_WNDW.hGLRC) == false)
{
	ERROR_H.Error_Log(&quot;wglMakeCurrent (1) failed!&quot;, false);
	return false;
}
&nbsp;
if (!InitGlew()) {
	return false;
}
&nbsp;
if (!InitwGlew()) {
	return false;
}
&nbsp;
return true;
}
//-----------------------------------------------------------------------
&nbsp;
bool TCore::Check_Folder(UnicodeString Folder)
{
if (!DirectoryExists(Folder)) {
	ERROR_H.Error_Log(&quot;Brak folderu &quot; + Folder, false);
	return false;
}
&nbsp;
return true;
}
//---------------------------------------------------------------------------
&nbsp;
bool TCore::InitApplication(void)
{
	SetDoubleClickTime(DblClickTime); //ustawia czas pomi&#281;dzy dwoma klikni&#281;ciami w podwójnym kliku
&nbsp;
	Load_Cursors();
&nbsp;
	if (!Check_Folder(APP.MeshesPath) || !Check_Folder(APP.TexturesPath) || !Check_Folder(APP.GUITexturesPath) || !Check_Folder(APP.SoundsPath) || !Check_Folder(APP.ShadersPath)) {
		return false;
	}
&nbsp;
	if (Create_Window(APP.hInstance, APP.Title, APP.Width, APP.Height) == false) {
		return false;
	}
&nbsp;
	if (Create_OpenGL() == false) {
		return false;
	}
&nbsp;
	if (!Make_Antialiasing()) {
		return false;
	}
&nbsp;
	//tworzenie contextu w wersji OpenGL 3.3
	if(WGLEW_ARB_create_context)
	{
		wglMakeCurrent(NULL,NULL); //???
		wglDeleteContext(OGL_WNDW.hGLRC);
&nbsp;
		int GL33RCAttribs&#91;&#93; =
		{
			WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
			WGL_CONTEXT_MINOR_VERSION_ARB, 3,
			WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
			0
		};
&nbsp;
		OGL_WNDW.hGLRC = wglCreateContextAttribsARB(APP.hDC, 0, GL33RCAttribs);
&nbsp;
		if(OGL_WNDW.hGLRC == NULL)
		{
			ERROR_H.Error_Log(&quot;wglCreateContextAttribsARB failed!&quot;, false);
			return false;
		}
&nbsp;
		if(wglMakeCurrent(APP.hDC, OGL_WNDW.hGLRC) == false)
		{
			ERROR_H.Error_Log(&quot;wglMakeCurrent (2) failed!&quot;, false);
			return false;
		}
	}
	else
	{
		ERROR_H.Error_Log(&quot;WGL_ARB_create_context not supported!&quot;, false);
		return false;
	}
&nbsp;
	glGetIntegerv(GL_MAX_TEXTURE_SIZE, &amp;TEX_SET.Max_Texture_Size);
    glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &amp;TEX_SET.Max_Texture_Units);
&nbsp;
	if(GLEW_EXT_texture_filter_anisotropic)
	{
		glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &amp;TEX_SET.Max_Anisotropy);
&nbsp;
		if (TEX_SET.Anisotropy_Filter_Samples &gt; TEX_SET.Max_Anisotropy) {
			TEX_SET.Anisotropy_Filter_Samples = TEX_SET.Max_Anisotropy;
		}
	}
&nbsp;
	//ustawianie VSync
	if (!OGL_WNDW.VSync_On) {
		if(WGLEW_EXT_swap_control)
		{
			wglSwapIntervalEXT(0);
		}
		else {
			ERROR_H.Error_Log(&quot;WGLEW_EXT_swap_control not supported!&quot;, false);
		}
	}
	else {
		if(WGLEW_EXT_swap_control)
		{
			wglSwapIntervalEXT(1);
		}
		else {
			ERROR_H.Error_Log(&quot;WGLEW_EXT_swap_control not supported!&quot;, false);
		}
    }
&nbsp;
	if (!GAME.Load_Game()) {
		return false;
	}
&nbsp;
	return true;
}
//------------------------------------------------------------------------------
&nbsp;
void TCore::Show_Window(bool Maximized)
{
	RECT dRect, wRect, cRect;
&nbsp;
	GetWindowRect(GetDesktopWindow(), &amp;dRect);
	GetWindowRect(APP.hWnd, &amp;wRect);
	GetClientRect(APP.hWnd, &amp;cRect);
&nbsp;
	wRect.right += APP.Width - cRect.right;
	wRect.bottom += APP.Height - cRect.bottom;
	wRect.right -= wRect.left;
	wRect.bottom -= wRect.top;
	wRect.left = dRect.right / 2 - wRect.right / 2;
	wRect.top = dRect.bottom / 2 - wRect.bottom / 2;
&nbsp;
	MoveWindow(APP.hWnd, wRect.left, wRect.top, wRect.right, wRect.bottom, FALSE);
&nbsp;
	ShowWindow(APP.hWnd, Maximized ? SW_SHOWMAXIMIZED : SW_SHOWNORMAL);
	UpdateWindow(APP.hWnd);
}
//-----------------------------------------------------------------------</pre></div></code><hr />
</div><br />
Textures generating:<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Generate_Texture_DDS(DDS_IMAGE_DATA *pDDSImageData1, bool Make_mipmaps, GLint Texture_Min_Filter, GLint Texture_Mag_Filter)
{
	if(pDDSImageData1 != NULL ) {
		int nHeight     = pDDSImageData1-&gt;height;
		int nWidth      = pDDSImageData1-&gt;width;
		int nNumMipMaps = pDDSImageData1-&gt;numMipMaps;
&nbsp;
		int nBlockSize;
&nbsp;
		if(pDDSImageData1-&gt;format == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)
            nBlockSize = 8;
        else
			nBlockSize = 16;
&nbsp;
		glPixelStorei(GL_UNPACK_ALIGNMENT, 1); //?
		glGenTextures(1, &amp;TEXTURE_MANAGER.Texture_s.Texture_ID);
		glBindTexture(GL_TEXTURE_2D, TEXTURE_MANAGER.Texture_s.Texture_ID);
&nbsp;
		//parametry tekstury
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, Texture_Min_Filter);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, Texture_Mag_Filter); // Filtrowanie liniowe
		glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
		glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, CORE.TEX_SET.Anisotropy_Filter_Samples);
&nbsp;
		int nSize;
        int nOffset = 0;
&nbsp;
        // Load the mip-map levels
		if (Make_mipmaps == false) {
			nNumMipMaps = 1;
		}
&nbsp;
        for(int i = 0; i &lt; nNumMipMaps; ++i) {
            if(nWidth  == 0) nWidth  = 1;
            if(nHeight == 0) nHeight = 1;
&nbsp;
            nSize = ((nWidth+3)/4) * ((nHeight+3)/4) * nBlockSize;
&nbsp;
			glCompressedTexImage2DARB(GL_TEXTURE_2D,
                                      i,
                                      pDDSImageData1-&gt;format,
									  nWidth,
									  nHeight,
                                      0,
                                      nSize,
                                      pDDSImageData1-&gt;pixels + nOffset);
&nbsp;
            nOffset += nSize;
&nbsp;
			// Half the image size for the next mip-map level...
			nWidth  = (nWidth  / 2);
            nHeight = (nHeight / 2);
        }
	}
}
//-----------------------------------------------------------------------
&nbsp;
void TTextureManager::Generate_Texture_BMP(unsigned char *TextureData, bool Make_mipmaps, GLint Texture_Min_Filter, GLint Texture_Mag_Filter)
{
glGenTextures(1, &amp;Texture_s.Texture_ID); // Utworzenie tekstury
glBindTexture(GL_TEXTURE_2D, Texture_s.Texture_ID); // ustawia tekstur&#281; jako bie&#380;&#261;c&#261; i w 2D
&nbsp;
//parametry tekstury
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, Texture_Min_Filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, Texture_Mag_Filter);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, CORE.TEX_SET.Anisotropy_Filter_Samples);
&nbsp;
if (BMP_has_alpha == true) {
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, BMP_Width, BMP_Height, 0, GL_BGRA, GL_UNSIGNED_BYTE, TextureData);
}
else {
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, BMP_Width, BMP_Height, 0, GL_BGR, GL_UNSIGNED_BYTE, TextureData);
}
&nbsp;
if (Make_mipmaps == true) {
	//The parameters to control the total number of mipmaps levels are given by:
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 4);
	glGenerateMipmap(GL_TEXTURE_2D);
}
}
//-----------------------------------------------------------------------</pre></div></code><hr />
</div><br />
Shaders:<br />
vertex:<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">#version 330 core
&nbsp;
// Input vertex data, different for all executions of this shader.
layout(location = 0) in vec3 vertexPosition_modelspace;
layout(location = 1) in vec4 vertexColor;
layout(location = 2) in vec2 vertexUV;
&nbsp;
// Output data ; will be interpolated for each fragment.
out vec4 fragmentColor;
out vec2 UV;
&nbsp;
// Values that stay constant for the whole mesh.
uniform mat4 MVP;
&nbsp;
void main(){
&nbsp;
	// Output position of the vertex, in clip space : MVP * position
	gl_Position =  MVP * vec4(vertexPosition_modelspace,1.0);
&nbsp;
	// The color of each vertex will be interpolated
	// to produce the color of each fragment
	fragmentColor = vertexColor;
&nbsp;
	// UV of the vertex. No special space for this one.
    UV = vertexUV;
}</pre></div></code><hr />
</div>fragment:<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">#version 330 core
&nbsp;
// Interpolated values from the vertex shaders
in vec4 fragmentColor;
in vec2 UV;
&nbsp;
// Ouput data
out vec4 color;
&nbsp;
// Values that stay constant for the whole mesh.
uniform int UseBaseColor;
uniform int UseTexture;
uniform int UseDiffuseMap;
uniform int UseNormalMap;
uniform int UseSpecularMap;
uniform int UseGlowMap;
uniform int UseLightMap;
uniform sampler2D DiffuseMap;
uniform sampler2D NormalMap;
uniform sampler2D SpecularMap;
uniform sampler2D GlowMap;
uniform sampler2D LightMap;
&nbsp;
void main()
{
&nbsp;
	if (UseTexture == 1 &amp;&amp; UseDiffuseMap == 1) {
		// Output color = color of the texture at the specified UV
    	color = texture(DiffuseMap, UV);
&nbsp;
		if (UseBaseColor == 1) {
			color = (color + fragmentColor) / 2.0;
		}
&nbsp;
		if (UseNormalMap == 1) {
			//color = color;
		}
&nbsp;
		if (UseSpecularMap == 1) {
			//color = color;
		}
&nbsp;
		if (UseGlowMap == 1) {
			color = color + texture(GlowMap, UV);
&nbsp;
			if (color.r &gt; 1.0) {
				color.r = 1.0;
			}
			if (color.g &gt; 1.0) {
				color.g = 1.0;
			}
			if (color.b &gt; 1.0) {
				color.b = 1.0;
			}
&nbsp;
			if (color.a &gt; 1.0) {
				color.a = 1.0;
			}
		}
&nbsp;
		if (UseLightMap == 1) {
			//color = color;
		}
	}
	else {
		// Output color = color specified in the vertex shader, 
		// interpolated between all 3 surrounding vertices
		color = fragmentColor;
	}
}</pre></div></code><hr />
</div><br />
Please help.</div>

]]></content:encoded>
			<category domain="http://www.opengl.org/discussion_boards/forumdisplay.php/6-OpenGL-coding-beginners">OpenGL coding: beginners</category>
			<dc:creator>starjacker0</dc:creator>
			<guid isPermaLink="true">http://www.opengl.org/discussion_boards/showthread.php/181709-OGL-3-3-MSAA-and-black-textures</guid>
		</item>
		<item>
			<title>glimg image dimesions</title>
			<link>http://www.opengl.org/discussion_boards/showthread.php/181707-glimg-image-dimesions?goto=newpost</link>
			<pubDate>Thu, 16 May 2013 04:21:49 GMT</pubDate>
			<description><![CDATA[I can't seem to figure out how to use glimg to find the width and height of an image that has been loaded into an image set. I know it uses the...]]></description>
			<content:encoded><![CDATA[<div>I can't seem to figure out how to use glimg to find the width and height of an image that has been loaded into an image set. I know it uses the glimg:: Dimensions class, but I cant figure out how this is done.</div>

]]></content:encoded>
			<category domain="http://www.opengl.org/discussion_boards/forumdisplay.php/6-OpenGL-coding-beginners">OpenGL coding: beginners</category>
			<dc:creator>Ygyaxthe3rd</dc:creator>
			<guid isPermaLink="true">http://www.opengl.org/discussion_boards/showthread.php/181707-glimg-image-dimesions</guid>
		</item>
		<item>
			<title>Physics engine for 2D</title>
			<link>http://www.opengl.org/discussion_boards/showthread.php/181703-Physics-engine-for-2D?goto=newpost</link>
			<pubDate>Thu, 16 May 2013 02:53:16 GMT</pubDate>
			<description>this question maybe asked a million times but please suggest me some physics engine for 2D game engine.Im using SDL and OpenGL.Now i want to add...</description>
			<content:encoded><![CDATA[<div>this question maybe asked a million times but please suggest me some physics engine for 2D game engine.Im using SDL and OpenGL.Now i want to add physics to it.I am planning on using an engine.please suggest me some engines with pros and cons. thanks in advance</div>

]]></content:encoded>
			<category domain="http://www.opengl.org/discussion_boards/forumdisplay.php/6-OpenGL-coding-beginners">OpenGL coding: beginners</category>
			<dc:creator>ragzzy-R</dc:creator>
			<guid isPermaLink="true">http://www.opengl.org/discussion_boards/showthread.php/181703-Physics-engine-for-2D</guid>
		</item>
		<item>
			<title><![CDATA[Isn't GLsizei supposed to be size_t?]]></title>
			<link>http://www.opengl.org/discussion_boards/showthread.php/181701-Isn-t-GLsizei-supposed-to-be-size_t?goto=newpost</link>
			<pubDate>Wed, 15 May 2013 20:12:44 GMT</pubDate>
			<description><![CDATA[According to the specification GLsizei  is "Non-negative binary integer size", what I understand is the type should be unsigned. But in my linux and...]]></description>
			<content:encoded><![CDATA[<div>According to the specification GLsizei  is &quot;Non-negative binary integer size&quot;, what I understand is the type should be unsigned. But in my linux and windows development environments &quot;gl.h&quot; defines it as &quot;<font color="#000000">typedef int GLsizei;&quot;. Moreover, <a href="http://www.opengl.org/registry/api/glcorearb.h" target="_blank">glcorearb.h</a> at the registry defines it as &quot;int&quot; as well. Do I understand the spec wrong? What am I missing?</font></div>

]]></content:encoded>
			<category domain="http://www.opengl.org/discussion_boards/forumdisplay.php/6-OpenGL-coding-beginners">OpenGL coding: beginners</category>
			<dc:creator>xahir</dc:creator>
			<guid isPermaLink="true">http://www.opengl.org/discussion_boards/showthread.php/181701-Isn-t-GLsizei-supposed-to-be-size_t</guid>
		</item>
		<item>
			<title>Make a 3D surface using heights alone</title>
			<link>http://www.opengl.org/discussion_boards/showthread.php/181700-Make-a-3D-surface-using-heights-alone?goto=newpost</link>
			<pubDate>Wed, 15 May 2013 15:44:59 GMT</pubDate>
			<description>I have 2D array with relative heights in in ranging from 0.0-5.5. 
for eg 
 
0    0     0    1.1    0  
0    0    1.1   1.1    0 
0   1.1   1.1  1.1 ...</description>
			<content:encoded><![CDATA[<div>I have 2D array with relative heights in in ranging from 0.0-5.5.<br />
for eg<br />
<br />
0    0     0    1.1    0 <br />
0    0    1.1   1.1    0<br />
0   1.1   1.1  1.1    0<br />
<br />
Now I want each index be seprarted by a 0.01 distance, or smaller, and at each index height be raised to value</div>

]]></content:encoded>
			<category domain="http://www.opengl.org/discussion_boards/forumdisplay.php/6-OpenGL-coding-beginners">OpenGL coding: beginners</category>
			<dc:creator>AroXar</dc:creator>
			<guid isPermaLink="true">http://www.opengl.org/discussion_boards/showthread.php/181700-Make-a-3D-surface-using-heights-alone</guid>
		</item>
	</channel>
</rss>
