Jump to content

  • Log In with Google      Sign In   
  • Create Account

Vanderry

Member Since 23 Jul 2009
Offline Last Active Feb 05 2014 12:22 PM

Topics I've Started

Indexing multiple VBOs

05 January 2014 - 02:26 PM

Hey you magnificent people !

 

I'm probably being a big dummy-dumb about this, but when using multiple VBOs for positional coords, normals, uvs etc - how would I use an index buffer correctly? Assuming only one IB can be used per draw call, is there any way to offset the buffer steps for each attribute so that a set of indices can be used for each vertex? If IBs can only hold one pointer per vertex then it seems to me like they wouldn't be very useful for more complex vertex definitions.

 

- Dave


C++ encapsulation

25 December 2012 - 12:55 PM

Hi !

 

I've been philosophizing about where to draw the line when it comes to encapsulation. It seems to me that when a class needs to contain data types that would preferably be forward declared in the header file, it would be most beneficial to just forward declare one structure to hold all of its member variables.

 

The way I see it, this first of all reduces the number of dynamic allocations needed to just one. It reduces the amount of redundant information visible through the class interface and nearly eliminates the need to recompile any file that is dependent of the class.

 

Does this seem like sound design? I'm curious to know why it is not a more common practice.

 

- Dave


Texture transition

26 May 2011 - 11:40 AM

Hey people !

I'm looking for a way to smoothly transition from one texture to another, not like a gradient but rather like fading from one to the other over a time interval. I would also like to use the fixed pipeline. Should I use use blending, render one texture first and then render the other on top using some particular blend func? I haven't figured out how to use those with a fine precision value yet.

Thanks in advance !

- Dave

Extracting transformation from box mesh

13 May 2011 - 02:56 PM

Hello people !

I have this transformed box mesh that I would like to extract the different transformation components (translation, rotation, scale) from. I'm able to extract vertex positions and their edge relationship, so it's easy to figure out the translation by adding them together and then dividing by 8. If I identify 3 perpendicular edges among the 12 that exist, the distance between their vertices should represent the scale (although I'm not sure about the order). The main thing that puzzles me is the rotation.

Would I be able to safely use the direction of those 3 edges to extract the rotation, and if so - how? It would be convenient to represent the transformation as a 4x4 matrix directly. Could I simply insert the 3 edges as column vectors into a 4x4 matrix and then add the translation into the last one? If this worked then the matrix could be applied to a unit size box and it would be identical to the one I started out with.

I hope I didn't mess up the problem description. Any help is appreciated !

- Dave

Texture splatting in OpenGL

20 April 2011 - 04:01 PM

Hey guys !

I'm trying to wrap my head around texture splatting in OpenGL. The way I would like to do this is by using black and white textures as alpha maps (or perhaps masks if it better describes the purpose), and apply this alpha to another, tiled, texture. When several layers are rendered this way I should ideally be able to blend the layers together to get nice texture transitions for terrains without having to use enormous highres textures.

What I can't figure out is the actual implementation. I'm guessing I will have to render the layers one by one, but how would I go about rendering one texture with the color of another one as alpha (no actual alpha channels involved)?

Thanks in advance for any help !

- Dave

PARTNERS