• 9
• 9
• 11
• 13
• 9
• ### Similar Content

• Good evening everyone!

I was wondering if there is something equivalent of  GL_NV_blend_equation_advanced for AMD?
Basically I'm trying to find more compatible version of it.

Thank you!

• Hello guys,

How do I know? Why does wavefront not show for me?
I already checked I have non errors yet.

And my download (mega.nz) should it is original but I tried no success...
- Add blend source and png file here I have tried tried,.....

PS: Why is our community not active? I wait very longer. Stop to lie me!
Thanks !

• I wasn't sure if this would be the right place for a topic like this so sorry if it isn't.
I'm currently working on a project for Uni using FreeGLUT to make a simple solar system simulation. I've got to the point where I've implemented all the planets and have used a Scene Graph to link them all together. The issue I'm having with now though is basically the planets and moons orbit correctly at their own orbit speeds.
I'm not really experienced with using matrices for stuff like this so It's likely why I can't figure out how exactly to get it working. This is where I'm applying the transformation matrices, as well as pushing and popping them. This is within the Render function that every planet including the sun and moons will have and run.
if (tag != "Sun") { glRotatef(orbitAngle, orbitRotation.X, orbitRotation.Y, orbitRotation.Z); } glPushMatrix(); glTranslatef(position.X, position.Y, position.Z); glRotatef(rotationAngle, rotation.X, rotation.Y, rotation.Z); glScalef(scale.X, scale.Y, scale.Z); glDrawElements(GL_TRIANGLES, mesh->indiceCount, GL_UNSIGNED_SHORT, mesh->indices); if (tag != "Sun") { glPopMatrix(); } The "If(tag != "Sun")" parts are my attempts are getting the planets to orbit correctly though it likely isn't the way I'm meant to be doing it. So I was wondering if someone would be able to help me? As I really don't have an idea on what I would do to get it working. Using the if statement is truthfully the closest I've got to it working but there are still weird effects like the planets orbiting faster then they should depending on the number of planets actually be updated/rendered.

• Hello everyone,
I have problem with texture

• Hello everyone
For @80bserver8 nice job - I have found Google search. How did you port from Javascript WebGL to C# OpenTK.?
I have been searched Google but it shows f***ing Unity 3D. I really want know how do I understand I want start with OpenTK But I want know where is porting of Javascript and C#?

Thanks!

# OpenGL glTexImage2D fails somehow

This topic is 3572 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, Pretty basic question, although I really don't know what's causing problems. I'm using glTexImage2D to load pixel data to a new texture. This works for cubeMaps, 3D textures, but not for simple 2D textures.
// Delphi Code
pixelData = array of array[0..3] of glFloat;
...
glEnable( GL_TEXTURE_2D );
glGenTextures( 1, @texHandle ); // @ == & in C
glBindTexture( GL_TEXTURE_2D, texHandle );

glTexImage2D( GL_TEXTURE_2D, 0,
GL_RGBA16F_ARB,
512, 512, // width, height
0,
GL_RGBA,
GL_FLOAT,
pixelData );

This results in a pure black texture. First I thought my pixelData array was just wrong. So I tried creating a 3D texture (with 1 slice) with the same pixelData. But that just works fine, and the creation code of the 3D texture is almost the same, except that I use glTexImage3D instead of glTexImage2D, and set GL_TEXTURE_3D as a target. At the point where I try to create this texture, I also create other cubemaps and 3D textures. So maybe OpenGL is in the wrong state when I try to create my texture? What could go wrong? Greetings, Rick

##### Share on other sites
http://www.opengl.org/wiki/index.php/Texture_Mapping

Quote:
 Some people make the mistake of not calling glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, MinFilter); and they get the default state GL_LINEAR_MIPMAP_NEAREST and they don't define the mipmaps, so the texture is considered incomplete and you just get a white textur

##### Share on other sites
I forgot to mention, right after the code I posted above, the parameters are set. I always use simple linear filtering, sometimes "nearest":
// Delphi CodepixelData = array of array[0..3] of glFloat;...glEnable( GL_TEXTURE_2D );glGenTextures( 1, @texHandle ); // @ == & in CglBindTexture( GL_TEXTURE_2D, texHandle );glTexImage2D( GL_TEXTURE_2D, 0,              GL_RGBA16F_ARB,              512, 512, // width, height              0,              GL_RGBA,              GL_FLOAT,              pixelData );glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

I checked my other code, and saw that the 4 "parameter lines" are placed before the glTexImage... line, instead of after. Maybe that could be a problem, in case OpenGL is expecting mipmaps in the first case like you said... I can't try changing the order right now, have to wait till tonight :)

Greetings,
Rick

##### Share on other sites
I always put the glTexParameter*() calls before I call glTexImage*(), but I don't think that makes a difference...

Are you using GL_RGBA16F_ARB on the cubemaps and 3D textures? What hardware are you on?