Jump to content

  • Log In with Google      Sign In   
  • Create Account


pinknation

Member Since 19 Apr 2007
Offline Last Active Aug 14 2012 10:25 PM

Posts I've Made

In Topic: [Theory] Unraveling the Unlimited Detail plausibility

24 May 2012 - 03:57 AM

To my above post which I cannot edit, I ment to say convert the 2D layers to radial, oh geeze I've been confusing those two a lot lately;

In Topic: [Theory] Unraveling the Unlimited Detail plausibility

24 May 2012 - 03:50 AM

try thinking more outside the box guys, unlimited detail isn't something that Bruce Dell found in some PDF file on rendering unlimited detail. He invented it, basically going against all other current techniques for rendering point data;

My gist of all this, is that the entire world(not just individual models and objects in the world), are sliced into 2D layers, and converged into cartesian coordinates; these coordinates are then during run-time almost magically reverse transformed to their proper screen-space coordinates after already being sorted through some unknown function;

Don't like that approach? We'll octree's have not been able to yeild those results in real-time either; So, lets try and take down the number of cycles, and complicated maths and leave it more simple, that's the only way he could process that much information in such a small amount of time. Accept it and move towards that; Computational Theory;

I'd also say that ray-tracing is really not the answer here as he states Thinking outside the box might be an example of this based on the cartesian idea, that is the screen-space may not be nothing more then some normals right, and just like when righting a script to do reflection, and refraction, you're no more moving a few pixels in the direction of that normal. So lets transform our cartesian coordinates with some dot product to our screen-space normal; what might happen then? Magical reverse transformation of the exact "atom" we need for that point on the screen. Without a lot of cycles; Or math.

This guy's been developing this thing for a long time, and deserves more respect for not having stuck to standards, and simply accepting the PDF's or Tutorials they find on GameDev as their ultimatum.

He went around and beyond, I say you stop fighting it, and embrace it; Just because he hasn't decided to populate it yet, does not mean that it isn't there. Give him time to perfect it, and make some affiliations with physics companies, who can then compute on the GPU while all graphics processing is being done on the CPU. This type of co-proccessing is what is going to make next-gen games next-gen; Be patient;

In Topic: GLSL Problems...

27 January 2010 - 12:06 PM

I am using glGetUniformLocation(); This is the exact code I'm using as far as my shaders go;


int filehash(char* fname)
{
unsigned int hash = 0;
while(*fname) {
hash = ((hash<<1) + (hash>>7)*9 + (unsigned int)tolower((unsigned char)(*fname)));
fname++;
}
return hash & 255;
}


class ShaderProperty
{
private:
GLint myLocation;
char *myName;
public:
ShaderProperty()
{
myLocation = 0;
myName = 0;
}

ShaderProperty(GLuint programHandle, char* propertyName)
{
myLocation = glGetUniformLocation(programHandle, propertyName);
printf("%d\n", myLocation);
}

void SetUniform1fv(int count, float *v)
{
glUniform1fv(myLocation, count, v);
}

void SetUniform2fv(int count, float *v)
{
glUniform2fv(myLocation, count, v);
}

void SetUniform3fv(int count, float *v)
{
glUniform3fv(myLocation, count, v);
}

void SetUniform4fv(int count, float *v)
{
glUniform4fv(myLocation, count, v);
}

void SetUniform1f(float v)
{
glUniform1f(myLocation, v);
}

void SetUniform2f(float v0, float v1)
{
glUniform2f(myLocation, v0, v1);
}

void SetUniform3f(float v0, float v1, float v2)
{
glUniform3f(myLocation, v0, v1, v2);
}

void SetUniform4f(float v0, float v1, float v2, float v3)
{
glUniform4f(myLocation, v0, v1, v2, v3);
}

char *GetName()
{
return myName;
}
};

class glShader
{
private:
GLuint myProgram, myVertexShader, myFragmentShader;
ShaderProperty *myProperties;

public:
static GLboolean IsSupported()
{
glewInit();
return glewIsSupported("GL_VERSION_2_0");
}

glShader() { /* nothing to do */ }

glShader(char *vert, char *frag)
{
myProperties = new ShaderProperty[255];

char *vs,*fs;

myVertexShader = glCreateShader(GL_VERTEX_SHADER);
myFragmentShader = glCreateShader(GL_FRAGMENT_SHADER);

vs = textFileRead(vert);
fs = textFileRead(frag);

const char * vv = vs;
const char * ff = fs;

glShaderSource(myVertexShader, 1, &vv,NULL);
glShaderSource(myFragmentShader, 1, &ff,NULL);

free(vs);
free(fs);

glCompileShader(myVertexShader);
glCompileShader(myFragmentShader);

myProgram = glCreateProgram();

glAttachShader(myProgram, myVertexShader);
glAttachShader(myProgram, myFragmentShader);

glLinkProgram(myProgram);
}

ShaderProperty GetProperty(char *name)
{
int idx = filehash(name);
if(myProperties[idx].GetName() != 0)
myProperties[idx] = ShaderProperty(myProgram, name);
return myProperties[idx];
}

void Begin()
{
glUseProgram(myProgram);
}

void End()
{
glUseProgram(0);
}

void Dispose()
{
glDetachShader(myProgram, myVertexShader);
glDetachShader(myProgram, myFragmentShader);
glUseProgram(0);
glLinkProgram(0);

glDeleteShader(myVertexShader);
glDeleteShader(myFragmentShader);
glDeleteProgram(myProgram);

delete [] myProperties;
}
};




and actually using those shaders during the rendernig process..


glPushMatrix();

//glEnable(GL_TEXTURE_2D);

myShader.Begin();
myShader.GetProperty("time").SetUniform1f((time_ += .005f));

// draw water surface
glBegin(GL_TRIANGLES);
float rw = 1.f / wWidth;
float rh = 1.f / wHeight;
float rZ = .0f;
for(int x = 0; x < wWidth; ++x)
{
for(int y = 0; y < wHeight; ++y)
{
float rx = (float)x;
float ry = (float)y;
// Top-Right
glTexCoord2f(rw * rx, rw * ry);
glVertex3f(rx + 0, rZ, ry + 0);

glTexCoord2f((rw * rx) + rw, rw * ry);
glVertex3f(rx + 1, rZ, ry + 0);

glTexCoord2f((rw * rx) + rw, (rw * ry) + rh);
glVertex3f(rx + 1, rZ, ry + 1);

// Lower-Left
glTexCoord2f(rw * rx, rw * ry);
glVertex3f(rx + 0, rZ, ry + 0);

glTexCoord2f(rw * rx, (rw * ry) + rh);
glVertex3f(rx + 0, rZ, ry + 1);

glTexCoord2f((rw * rx) + rw, (rw * ry) + rh);
glVertex3f(rx + 1, rZ, ry + 1);
}
}
glEnd();

myShader.End();

glDisable(GL_TEXTURE_2D);

glPopMatrix();




[EDIT]
well, LOL.. while looking at the code above(to make sure there were no errors while I copied/pasted) I noticed an error in my GetProperty() function, and fixed some logic..
ShaderProperty GetProperty(char *name)
{
int idx = filehash(name);
if(myProperties[idx].GetName() == 0)
myProperties[idx] = ShaderProperty(myProgram, name);
return myProperties[idx];
}

it was != 0, and is now == 0; before it set it everytime, and i think thats where it lost the original location, and replaced it with some NULL one ( or random ?);

anyways, it works now.. hah!


In Topic: Optimized Collision Detection & Physics

18 August 2009 - 11:09 AM

thanks again Flounder. <3 not 100% sure why I did that..

think I'm done w/ help for now, unless anyone can explain how to solve the collision issue..

In Topic: Optimized Collision Detection & Physics

18 August 2009 - 09:03 AM

It's all good, thanks.. I'm just having issues now with particles colliding with one another, after the collision tests have completed. :[ I've been reading up on more collision detection & response, though I'm not understanding how to resolve this problem in an non-costly manner, like all that keeps coming to mind is 'BRUTE-FORCE BRUTE-FORCE BRUTE-FORCE'. ^_^

PARTNERS