Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 18 Nov 2005
Offline Last Active Today, 01:55 AM

#4953411 Multitexturing and glBindTexture

Posted by dpadam450 on 27 June 2012 - 12:48 PM

Not sure what you mean. You have 8 texture units by default. You can bind any texture you want to any unit, and they remain there for the life of the program no matter what unit is active or if texturing is disabled for that unit. The texture will stay bound even if texturing is disabled.

If you have a model with 3 textures, 2 textures and 1 texture, you can do:
drawModel3(); //again

That what you mean?

#4952382 Texture Transparency Issue

Posted by dpadam450 on 24 June 2012 - 11:51 AM

It is either rendering first and blending with a white background. Or your mip-maps are being downsampled wrong and taking in the transparent pixels as white and blending them in with the actual pixels.

#4952041 3D painting

Posted by dpadam450 on 23 June 2012 - 11:18 AM


Never used it but it lists the feature to do 3D painting.

#4951533 Making glowing objects

Posted by dpadam450 on 21 June 2012 - 04:59 PM

Pretty much looks like a glow texture that has alpha on the edges. Nothing special that it looks like they are doing.

#4950331 High performance texture splatting?

Posted by dpadam450 on 18 June 2012 - 12:37 PM

Also, Why not try just 3 splat channels instead of 4. 3 should be sufficient especially if it is for a small screen embedded device.

#4950066 OpenGL performance question

Posted by dpadam450 on 17 June 2012 - 01:30 PM

I usually do what is simple and optimize if needed later. I have never seen a UI with more than 50 different textures/elements which would be something like starcraft 2. For one, you only need a vbo of a square -.5 to .5 in size and just scale it with a new texture on it. To optimize that a bit, you can use a texture arrray so that you don't have to bind a texture for each image. But even then, just go with the simple solution first.

I think a lot of people think about optimizing the dumbest things. This is negligible at this point. GPU's /CPU's and motherboards are very fast. If you end up making a game that even uses so much power that it dips below 30 or 60 fps (whichever is your goal), then optimize. Until then, just get the game working, you may not need to even optimize once its all done.

#4949616 Sending data questions

Posted by dpadam450 on 15 June 2012 - 12:10 PM

To the OP: what I meant was:
To do this create a char Buffer[1000];
int offset = 0;
memcpy(&(Buffer[offset]), l_data.m_data, ...sizeof(YOUR_M_DATA));
offset += sizeof(YOUR_M_DATA);
memcpy(&(Buffer[offset]), &l_data.m_id, 4);//integer is 4 bytes

Basically you have to copy what is actually in the pointer itself was what I was getting at.

#4949421 Sending data questions

Posted by dpadam450 on 14 June 2012 - 10:12 PM

Your packet holds a pointer (which is an address) and an integer. It will send:
Address of l_data;
Integer id;

What you want to send is
l_data (including all its members like say position, name, rotation whatever online data)
Integer id;

To do this create a char Buffer[1000];
int offset = 0;
memcpy(&(Buffer[offset]), l_data, ...sizeof(SomeStructure));
offset += sizeof(SomeStructure);
memcpy(&(Buffer[offset]), &id, 4);//integer is 4 bytes

SendTo(.....Buffer, offset);//sending "offset bytes" which is 4 + sizeof(SomeStructure)

#4948179 Clouds in OpenGL?

Posted by dpadam450 on 11 June 2012 - 09:08 AM

Just use billboarded sprites like you would with any particle system.

#4947691 Processing time at vertex shader

Posted by dpadam450 on 09 June 2012 - 10:36 AM

You will never be able to track that. But also, there is no vertex shader anymore:
Read stream processor.

#4946658 Rotating a FPS view model

Posted by dpadam450 on 05 June 2012 - 11:42 PM

For something like an FPS where the gun/hands are always relative to the camera. Then you don't need a view matrix. Just call glLoadIdentity() and treat it that way. It doesn't ever matter where or what your camera is looking at.

#4945457 Multiplying blood splatters on a plane surface

Posted by dpadam450 on 01 June 2012 - 06:03 PM

glBlendFunc(src, dst)
You probably can do glBlendFunc(GL_DST_COLOR, GL_ZERO);
Which should multiply the src*dst, and dst*0
so output = src*dst + 0 = red*green in your picture.

#4945155 gl_ClipVertex alternative

Posted by dpadam450 on 31 May 2012 - 07:23 PM

And the reason it wasnt nonsense is because if you dont write gl_FragDepth, it is taken care of before the pixel shader and early z-discard takes place before the shader. I assumed it might happen for clip planes in the current specs.

#4945154 gl_ClipVertex alternative

Posted by dpadam450 on 31 May 2012 - 07:22 PM

I didn't know the answer on my first comment but it helped him. Better to post something than nothing to get him trying something. Your response was only a day later than mine and I've never seen your name in the GL forums in the 7 years I've been on it, so I actually know quite a bit. Stop being a douche.

#4945067 gl_ClipVertex alternative

Posted by dpadam450 on 31 May 2012 - 01:18 PM

did you try writing the array at [0] and [1] ? I assume that it just works under the hood that when you compile the shader it knows you will only clip 2 planes.