Jump to content

  • Log In with Google      Sign In   
  • Create Account

hdxpete

Member Since 26 Oct 2011
Offline Last Active Dec 19 2014 02:11 AM

Topics I've Started

C++ 64 bit void */int conversion addressing questions

01 December 2014 - 12:36 AM

Hello,

 

I am currently upgrading a game engine from a 32bit system to a 64 bit system. there are definate spots where the original author was holding a pointer in an int. 

 

struct myrefdata

{

  int data;

};

 

now i want to upgrade this to a 64 bit system. my initial idea was that this should be a void * instead of an int so

 

struct myrefdata

{

  void *data;

};

 

now what i am finding is where the author did intend to actually hold an int in this field needs to be adjusted.

 

int x = 100;

myRefData->data = x;

int y = (int)myRefData->data;

 

while this example is a large oversimplication. i was wondering for those with more 64bit experience that me for assistance.

 

i am using c++11 on all my target platforms.

how can i correctly convert a int to a void * and a void * to int, for the times i do want to hold an int in a void *?

 

 

another question...

 

assuming that there are other sections of the game engine where it is just impossible to convert that int to a void * but it does hold a pointer, is there a way i can force a memalloc in the 32bit space? or if i cant do that declare an array in global space of the program to hold the pointer and put this array in 32bit memory space.

 

 

very much appreciate any help anyone could provide.


gles2.0 lowp, mediump, highp precision sizes

28 October 2014 - 03:37 AM

hello, 

 

apologizes up front. my google-fuu is a complete failure today. i'm looking for information on the minimum sizes of lowp, mediump, and highp for opengl gl es 2.0.

 

if someone knows where to find this information i would be most grateful.

 

thank you


bounding box culling with just model view projection matrix

02 October 2013 - 03:02 AM

Hello,

 

i'm trying to implement culling in my project. for various reasons at the point that i can make a draw decision and want to test if i should cull the geometry i have the following available to me

 

1. a bounding box of the geometry in question

2. the model view projection matrix that will be sent to the shader.

 

i really have no other information in which to base a decision on.

 

 

my current algorithm is similiar to (pseudocode)







for(int i = 0 ; i < 7 ; i++)
{
    testCorner[i] = boxCorner[i] * mvpMatrix;
    testCorner[i].x /= testCorner[i].w;
    testCorner[i].y /= testCorner[i].w;
    testCorner[i].z /= testCorner[i].w;
}

bool clipMe = true;
for(int i = 0 ; (i < 7) && (clipMe == true) ; i++)
{
    if(testCorner[i].z > 0.0)
    {
        if(testCorner[i].x > -1 && testCorner[i].x < 1)
        {
            clipMe = false;
        }
        if(testCorner[i].y > -1 && testCorner[i].y < 1)
        {
            clipMe = false;
        }
    }
}

However i find that sometimes a piece of geometry that should not get clipped will get clipped. Has anyone else used a method similiar to this before? Anyone can point me toward what i'm doing wrong?

 

very much appreciated.


glUniform and 1 large buffer

23 June 2013 - 07:06 PM

Directx 11 has a very nice (from my pov) way to deal with shader parameters via the constant buffer.  it seems to me that it would be really cool if i could do the same thing in opengl

ie. just pass for example 200 bytes of float data and have it fill a struct that is 200 bytes long in the shader. ok... i get it the data im transfering to the shader might not be 200 bytes for that GPU etc etc etc.

 

however setting (for example) 30 uniform values for every uniform in the shader seems slow. is there an extention that would behave similiar to directx?

 

thanks for reading 


HW accel Matrices on android (NDK)

08 June 2013 - 11:34 PM

on windows/directx i have XMMATRIX. on ios i have GLKit and GLKMATRIX. i can't seem to find a hardware accelerated matrix library (for example on armv7 uses NEON extension for matrix multiply) for android that i can use on the C++/NDK side. anyone have any recommendations?

 

thanks a bunch.


PARTNERS