Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

slicer4ever

Member Since 02 Nov 2008
Online Last Active Today, 03:20 AM
***--

Topics I've Started

glVertexAttribPointer for interleaved array's.

06 May 2013 - 06:34 AM

I can't seem to find an answer for this with openGL, but recently when using PSM i've found that I can pass an interleaved array to the shader, and the api can map my interleaved arrays to the shader inputs without any fuss. It reduces alot of additional calls for setting up where each specific part of the vbo has to go.

I'm curious if their is something like this for openGL that i haven't found. I'd like it to be 3.0 capable if possible, but instead of doing:
...
glVertexAttribPointer(PosIdx, 4, GL_FLOAT, sizeof(myvertex), 0x0);
glVertexAttribPointer(ClrIdx, 4, GL_FLOAT, sizeof(myvertex), 0x10);
glVertexAttribPointer(NrmIdx, 3, GL_FLOAT, sizeof(myvertex), 0x20); //I know, padding, just an example!
glVertexAttribPointer(TexIdx, 2, GL_FLOAT, sizeof(myvertex), 0x2C);
//etc, etc
...
i could do something like:
glVertexAttribBlock(BlockIdx, sizeof(myvertex), 0, 0x0);
//Index to attribute block, size of the block in bytes, stride(0 is tightly packed), offset into vbo)

Handling other languages and font.

29 April 2013 - 08:20 AM

my current font system is pretty simple, at the game launch, I build a texture palette of common letters, with ascii this is generally between glyphs 32 to 96 covers the English language pretty decently.  Then when i draw a string, I just create a mesh, with the appropriate texture coordinates for the glyph, and do a check that the glyph is inside my range of supported glyphs.

 

However, i've been thinking of how to extend this to other languages, my palette system can be modified to use unicode glyphs relatively easily, but I don't know what a good range is for covering a good variety of common characters in say Chinese, Japanese, french, German, russian etc.  since the input from players is likely going to be in their language, rather than english(particularly if targeting mobile platforms), these would mean that when i'm drawing something with my font code, it wouldn't draw anything as all the input glyphs could be outside my supported range.  creating a texture with all possible glyphs seems rather insane as well.  I've also considered having "pages" of textures, but that would be rather inefficient as it means having to switch textures every time a glyph in a different "page" is detected.

 

so what are other people's solutions for dealing with this problem?


LiquidGames

23 April 2013 - 03:15 PM

hey good people of gamedev, long time member is working on a start-up game company.

 

we've built several games so far, all aimed for the playstation mobile market.

 

https://www.facebook.com/LiquidGames

 

enjoy some gameplay of our upcoming game apocalypse defense, featuring multi-player tower defense/offense gameplay:

 

 


C# Constrained Generic's and derived static methods.

05 April 2013 - 07:47 PM

I'm going over a design problem I have. basically I have a generic mesh class, that i feed some derived type that is of the base type Vertex. so, my problem is that I want the derived class to be able to pass information to the mesh class that is specific for it's implementation(it's pretty much the gpu formatting for that type).

something like this(note this is a sample to demonstrate the probelm, so try not to get caught up on the pointless-ness of the code):
public class abstract Foo{
  public abstract int GetX();
};

public class Foo_A : Foo{
  public override int GetX(){
     return 1;
  }
};

class class OtherClass<T> where T : Foo{

   public void GetTX(){
     return T.GetX();
   }
}
basically, the result of GetX doesn't need anything inside of the class, it just provides additional information for my OtherClass to access. One way I know i can make this work is to create an instance of T, in my particular case I have an array of T already, so i just call the method by accessing the first member of the array, but this feels incredibly dirty.

basically i need some type of static abstract class or const, since i'm going to be accessing OtherClass like so:
OtherClass<Foo_A> = new OtherClass<Foo_A>();
I feel their should be a way for me to access a static method in Foo_A through the OtherClass.

Google's new nose feature.

01 April 2013 - 12:32 AM

http://www.google.com/landing/nose/

I'm just blown away, so many new things i can smell, and I never have to leave my couch. Just one less excuse to leave my home.

PARTNERS