Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* all FBOs now according to window size

* no more scene_size!
* fixed lighting/shadow misalignment with varying light/shadow resolutions
* thus greatly improved framerate!
  • Loading branch information...
commit ab0687b21d44e6ff499308a1f40d47d5ede1efd3 1 parent 34e3b4d
@fiezi authored
View
BIN  Moviesandbox.exe
Binary file not shown
View
8 classes/actor.cpp
@@ -533,6 +533,14 @@ void Actor::updateShaders(){
glUniform1fARB(myShader->uniforms["scene_size"], (float)renderer->scene_size);
}
+ if (myShader->uniforms.find("screenX") != myShader->uniforms.end()){
+ glUniform1fARB(myShader->uniforms["screenX"], (float)renderer->screenX);
+ }
+
+ if (myShader->uniforms.find("screenY") != myShader->uniforms.end()){
+ glUniform1fARB(myShader->uniforms["screenY"], (float)renderer->screenY);
+ }
+
if (myShader->uniforms.find("fov") != myShader->uniforms.end()){
glUniform1fARB(myShader->uniforms["fov"], (float)renderer->fov);
}
View
11 classes/input.cpp
@@ -617,7 +617,16 @@ void Input::keyUp(unsigned char key,int x,int y){
}
}
-
+
+ //switch fullscreen
+ if (key=='F'){
+ if (renderer->bFullscreen){
+ glutLeaveGameMode();
+ }else{
+ glutEnterGameMode();
+ }
+ renderer->bFullscreen=!renderer->bFullscreen;
+ }
View
2  classes/main.cpp
@@ -223,7 +223,7 @@ int main(int argc, char* argv[]){
//startFileLog();
- glutInit(&argc, argv);
+ glutInit(&argc, argv);
#ifdef TARGET_MACOSX
CGSetLocalEventsSuppressionInterval(0);
View
72 classes/renderer.cpp
@@ -249,13 +249,14 @@ void Renderer::registerProperties(){
void Renderer::initWindow(int x, int y, string windowName){
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA | GLUT_MULTISAMPLE);
+
+ char* gmString = new char[64];
+ sprintf(gmString," %ix%i:32@60",screenX,screenY);
+ glutGameModeString( gmString );
if (bFullscreen)
{
// windowX x windowY, 32bit pixel depth, 60Hz refresh rate
- char* gmString = new char[64];
- sprintf(gmString," %ix%i:32@60",windowX,windowY);
- glutGameModeString( gmString );
// start fullscreen game mode
glutEnterGameMode();
}
@@ -377,7 +378,8 @@ void Renderer::setup(){
//frame buffer objects
//always need them with layer system!
-
+
+ /*
//buffer to copy from for FSAA multisampling in FBOs
createFBO(&multiSample_fb, NULL, &multiSample_db, scene_size, false, "multisampleBuffer");
@@ -385,6 +387,14 @@ void Renderer::setup(){
createFBO(&lighting_fb, &lighting_tx, NULL, scene_size, false, "lighting"); //uses scene_size because it's the final FBO in which we compute everything!
createFBO(&shadow_fb, &shadow_tx, NULL, shadow_size, false, "shadow");
createFBO(&scene_fb, &scene_tx, NULL, scene_size, false, "scene");
+*/
+//buffer to copy from for FSAA multisampling in FBOs
+ createFBO(&multiSample_fb, NULL, &multiSample_db, screenX, screenY, false, "multisampleBuffer");
+
+ //framebuffer and texture to store global lighting and shadow information
+ createFBO(&lighting_fb, &lighting_tx, NULL, screenX, screenY, false, "lighting"); //uses scene_size because it's the final FBO in which we compute everything!
+ createFBO(&shadow_fb, &shadow_tx, NULL, shadow_size,shadow_size, false, "shadow");
+ createFBO(&scene_fb, &scene_tx, NULL, screenX, screenY, false, "scene");
#ifdef BDEBUGRENDERER
checkOpenGLError("FBO Error check...");
@@ -486,7 +496,7 @@ void Renderer::physicsUpdate(){
-void Renderer::createFBO(GLuint* fbObject, GLuint* fbTexture, GLuint* fbDepth, int fbSize, bool bDepth, string name){
+void Renderer::createFBO(GLuint* fbObject, GLuint* fbTexture, GLuint* fbDepth, int fbSizeX, int fbSizeY, bool bDepth, string name){
//-------------------------------------------------------
// framebuffer object
@@ -509,9 +519,9 @@ void Renderer::createFBO(GLuint* fbObject, GLuint* fbTexture, GLuint* fbDepth, i
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, multiSample_color);
if (bMultisample)
- glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, numSamples, sampleType, fbSize, fbSize);
+ glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, numSamples, sampleType, fbSizeX, fbSizeY);
else
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, sampleType, fbSize, fbSize);
+ glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, sampleType, fbSizeX, fbSizeY);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
@@ -520,25 +530,25 @@ void Renderer::createFBO(GLuint* fbObject, GLuint* fbTexture, GLuint* fbDepth, i
glGenRenderbuffersEXT(1, &multiSample_depth);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, multiSample_depth);
if (bMultisample)
- glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, numSamples, sampleType, fbSize, fbSize);
+ glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, numSamples, sampleType, fbSizeX, fbSizeY);
else
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, sampleType, fbSize, fbSize);
+ glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, sampleType, fbSizeX, fbSizeY);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
glGenRenderbuffersEXT(1, &multiSample_pick);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, multiSample_pick);
if (bMultisample)
- glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, numSamples, sampleType, fbSize, fbSize);
+ glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, numSamples, sampleType, fbSizeX, fbSizeY);
else
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, sampleType, fbSize, fbSize);
+ glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, sampleType, fbSizeX, fbSizeY);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
glGenRenderbuffersEXT(1, &multiSample_lightData);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, multiSample_lightData);
if (bMultisample)
- glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, numSamples, sampleType, fbSize, fbSize);
+ glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, numSamples, sampleType, fbSizeX, fbSizeY);
else
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, sampleType, fbSize, fbSize);
+ glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, sampleType, fbSizeX, fbSizeY);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
//DEPTH COMPONENT
@@ -546,9 +556,9 @@ void Renderer::createFBO(GLuint* fbObject, GLuint* fbTexture, GLuint* fbDepth, i
glGenRenderbuffersEXT(1, &multiSample_db);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, multiSample_db);
if (bMultisample)
- glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, numSamples, GL_DEPTH_COMPONENT, fbSize, fbSize);
+ glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, numSamples, GL_DEPTH_COMPONENT, fbSizeX, fbSizeY);
else
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, fbSize, fbSize);
+ glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, fbSizeX, fbSizeY);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
@@ -581,7 +591,7 @@ void Renderer::createFBO(GLuint* fbObject, GLuint* fbTexture, GLuint* fbDepth, i
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
- glTexImage2D (GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, fbSize, fbSize, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
+ glTexImage2D (GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, fbSizeX, fbSizeY, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
@@ -592,8 +602,8 @@ void Renderer::createFBO(GLuint* fbObject, GLuint* fbTexture, GLuint* fbDepth, i
cout << "no depth in FBO!" << name << endl;
// attach colorBuffer to a texture
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
- glTexImage2D(GL_TEXTURE_2D, 0, sampleType, fbSize, fbSize, 0, GL_RGBA, GL_FLOAT, NULL);
- //glTexImage2D(GL_TEXTURE_2D, 0, sampleType, fbSize, fbSize, 0, GL_RGBA, GL_BYTE, NULL);
+ glTexImage2D(GL_TEXTURE_2D, 0, sampleType, fbSizeX, fbSizeY, 0, GL_RGBA, GL_FLOAT, NULL);
+ //glTexImage2D(GL_TEXTURE_2D, 0, sampleType, fbSizeX, fbSizeY, 0, GL_RGBA, GL_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR);
@@ -609,7 +619,7 @@ void Renderer::createFBO(GLuint* fbObject, GLuint* fbTexture, GLuint* fbDepth, i
if (fbDepth){
glGenRenderbuffersEXT(1, fbDepth);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, *fbDepth);
- glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, fbSize, fbSize);
+ glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, fbSizeX, fbSizeY);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
@@ -846,7 +856,8 @@ void Renderer::draw(){
//draw into FBO for post-production
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, sceneData->layerList[i]->sceneFBO);
- glViewport (0, 0, scene_size, scene_size);
+ //glViewport (0, 0, scene_size, scene_size);
+ glViewport (0, 0, screenX, screenY);
//Draw Background here
drawBackground();
@@ -1031,8 +1042,8 @@ void Renderer::drawSceneTexture(){
glPushAttrib(GL_VIEWPORT_BIT);
- //glViewport (0, 0, screenX, screenY);
- glViewport (0, 0, scene_size, scene_size);
+ glViewport (0, 0, screenX, screenY);
+ //glViewport (0, 0, scene_size, scene_size);
glMatrixMode(GL_MODELVIEW);
@@ -1069,7 +1080,7 @@ void Renderer::drawSceneTexture(){
glBindFramebufferEXT( GL_DRAW_FRAMEBUFFER_EXT, sceneData->layerList[i]->colorFBO );
glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
- glBlitFramebufferEXT( 0, 0, scene_size, scene_size, 0, 0, scene_size, scene_size, GL_COLOR_BUFFER_BIT, GL_NEAREST );
+ glBlitFramebufferEXT( 0, 0, screenX, screenY, 0, 0, screenX, screenY, GL_COLOR_BUFFER_BIT, GL_NEAREST );
//meta blitting - zPos, ObjectID, vertexID
glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
@@ -1077,7 +1088,7 @@ void Renderer::drawSceneTexture(){
glBindFramebufferEXT( GL_DRAW_FRAMEBUFFER_EXT, sceneData->layerList[i]->depthFBO );
glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
- glBlitFramebufferEXT( 0, 0, scene_size, scene_size, 0, 0, scene_size, scene_size, GL_COLOR_BUFFER_BIT, GL_NEAREST );
+ glBlitFramebufferEXT( 0, 0, screenX, screenY, 0, 0, screenX, screenY, GL_COLOR_BUFFER_BIT, GL_NEAREST );
}
//cleanup
@@ -1115,7 +1126,8 @@ void Renderer::drawDeferredLighting(Layer* layer){
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT,0);
glPushAttrib(GL_VIEWPORT);
- glViewport (0, 0, lighting_size, lighting_size);
+ //glViewport (0, 0, lighting_size, lighting_size);
+ glViewport (0, 0, screenX, screenY);
//set our textureID to lighting pass
@@ -2265,15 +2277,19 @@ void Renderer::pick(int x, int y){
//create small picking texture
glBindTexture(GL_TEXTURE_2D,pickTexture);
- float xRatio=(float)scene_size/(float)screenX;
- float yRatio=(float)scene_size/(float)screenY;
+// float xRatio=(float)scene_size/(float)screenX;
+// float yRatio=(float)scene_size/(float)screenY;
+
+ float xRatio=1.0;
+ float yRatio=1.0;
glCopyTexSubImage2D(GL_TEXTURE_2D,0,0,0,(int) (input->mouseX * xRatio),(int) ((screenY-input->mouseY)*yRatio) ,1 ,1 );
glGetTexImage(GL_TEXTURE_2D,0,GL_BGRA,GL_FLOAT,&mousePos);
- glCopyTexSubImage2D(GL_TEXTURE_2D,0,0,0,(int) (scene_size/2.0),(int) (scene_size/2.0) ,1 ,1 );
+ //glCopyTexSubImage2D(GL_TEXTURE_2D,0,0,0,(int) (scene_size/2.0),(int) (scene_size/2.0) ,1 ,1 );
+ glCopyTexSubImage2D(GL_TEXTURE_2D,0,0,0,(int) (screenX/2.0),(int) (screenY/2.0) ,1 ,1 );
glGetTexImage(GL_TEXTURE_2D,0,GL_BGRA,GL_FLOAT,&centerInfo);
//Shader writes data as follows:
View
2  classes/renderer.h
@@ -189,7 +189,7 @@ class Renderer: public MsbObject{
virtual void physicsUpdate();
- virtual void createFBO(GLuint* fbObject, GLuint* fbTexture, GLuint* fbDepth, int fbSize, bool bDepth, string name);
+ virtual void createFBO(GLuint* fbObject, GLuint* fbTexture, GLuint* fbDepth, int fbSizeX, int fbSizeY, bool bDepth, string name);
virtual void checkFBOStatus();
virtual void draw();
View
7 classes/sceneData.cpp
@@ -673,11 +673,18 @@ void SceneData::addLayer(string layerName){
lay->lightDataTextureID=lay->name+"_lightData";
layerList.push_back(lay);
+ /*
renderer->createFBO(&(lay->sceneFBO), &(lay->sceneTex), NULL, renderer->scene_size, false, lay->sceneTextureID);
renderer->createFBO(&(lay->colorFBO), &(lay->colorTex), NULL, renderer->scene_size, false, lay->colorTextureID);
renderer->createFBO(&(lay->depthFBO), &(lay->depthTex), NULL, renderer->scene_size, false, lay->depthTextureID);
renderer->createFBO(&(lay->pickFBO), &(lay->pickTex), NULL, renderer->scene_size, false, lay->pickTextureID);
renderer->createFBO(&(lay->lightDataFBO), &(lay->lightDataTex), NULL, renderer->scene_size, false, lay->lightDataTextureID);
+*/
+ renderer->createFBO(&(lay->sceneFBO), &(lay->sceneTex), NULL, renderer->screenX,renderer->screenY, false, lay->sceneTextureID);
+ renderer->createFBO(&(lay->colorFBO), &(lay->colorTex), NULL, renderer->screenX,renderer->screenY, false, lay->colorTextureID);
+ renderer->createFBO(&(lay->depthFBO), &(lay->depthTex), NULL, renderer->screenX,renderer->screenY, false, lay->depthTextureID);
+ renderer->createFBO(&(lay->pickFBO), &(lay->pickTex), NULL, renderer->screenX,renderer->screenY, false, lay->pickTextureID);
+ renderer->createFBO(&(lay->lightDataFBO), &(lay->lightDataTex), NULL, renderer->screenX,renderer->screenY, false, lay->lightDataTextureID);
currentLayer=layerList.size()-1;
cout << "Added new Layer:" << layerName << endl;
View
2  classes/viewportGizmo.cpp
@@ -28,7 +28,7 @@ void ViewportGizmo::setup(){
renderer->createEmptyTexture("viewportGizmo",GL_RGBA,GL_FLOAT,50,50);
//also, create an FBO
- renderer->createFBO(&viewport_fb,&(sceneData->textureList["viewportGizmo"]->texture),&myDepthBuffer,50,false, "viewportGizmo");
+ renderer->createFBO(&viewport_fb,&(sceneData->textureList["viewportGizmo"]->texture),&myDepthBuffer,50,50,false, "viewportGizmo");
scale.x=50;
View
6 config.xml
@@ -9,9 +9,9 @@
bDrawLighting="1"
bMultisample="0"
numSamples="2"
- ShadowSize="1024"
- LightingSize="1024"
- SceneSize="1024"
+ ShadowSize="256"
+ LightingSize="256"
+ SceneSize="256"
MouseSensitivity="0.04"
MoveSpeed="8.0"
FOV="45"
View
2  shaders/aliveTexture.vert
@@ -51,7 +51,7 @@ void main(){
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * myVertex;
- gl_PointSize= pointSize() * screensize/scene_size;
+ gl_PointSize= pointSize();
picking = cameraInverse * gl_ModelViewMatrix * myVertex ;
picking.w = objectID;
View
2  shaders/color.vert
@@ -45,7 +45,7 @@ void main(){
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * myVertex;
//this here is an approximation
- gl_PointSize= pointSize() * screensize/scene_size * (45.0*45.0)/(fov*fov);
+ gl_PointSize= pointSize() * (45.0*45.0)/(fov*fov);
zPos=gl_Position.z;
View
2  shaders/colorAlphaID.vert
@@ -45,7 +45,7 @@ void main(){
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * myVertex;
//this here is an approximation
- gl_PointSize= pointSize() * screensize/scene_size * (45.0*45.0)/(fov*fov);
+ gl_PointSize= pointSize() * (45.0*45.0)/(fov*fov);
zPos=gl_Position.z;
View
2  shaders/drawing.vert
@@ -48,7 +48,7 @@ void main(){
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * myVertex;
- gl_PointSize= pointSize() * screensize/scene_size;
+ gl_PointSize= pointSize();
pSize=gl_PointSize;
View
2  shaders/illustration.vert
@@ -47,7 +47,7 @@ void main(){
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * myVertex;
- gl_PointSize= pointSize() * (1.15+0.15* sin(0.001* time + objectID +xC+myVertex.y)) * screensize/scene_size;
+ gl_PointSize= pointSize() * (1.15+0.15* sin(0.001* time + objectID +xC+myVertex.y));
zPos=gl_Position.z;
View
2  shaders/particleHeightField.vert
@@ -48,7 +48,7 @@ void main(){
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * myVertex;
- gl_PointSize= pointSize()* screensize/scene_size;
+ gl_PointSize= pointSize();
zPos=gl_Position.z;
View
21 shaders/post/deferredLight.frag
@@ -2,7 +2,8 @@ uniform float time;
uniform float screensize;
uniform float lighting_size;
uniform float shadow_size;
-uniform float scene_size;
+uniform float screenX;
+uniform float screenY;
uniform float nearClip;
uniform float farClip;
@@ -32,7 +33,7 @@ varying vec2 texCoord;
float lightDistance = 100.0;
-const float specularExp = 128.0;
+const float specularExp = 16.0;
vec4 fragWorldLoc;
float zPos;
@@ -99,8 +100,8 @@ vec4 calcFragmentWorldSpace(){
fW.xyz= camLoc;
//fW.xyz+= camZ * (1.0+zPosScreen);
fW.xyz+= camZ * (zPos);
- fW.xyz-= camX * ((gl_FragCoord.x/scene_size - 0.5) * zPos);// * 1.1);
- fW.xyz+= camY * ((gl_FragCoord.y/scene_size - 0.5) * zPos * 768.0/scene_size);// * 1.1);
+ fW.xyz-= camX * ((gl_FragCoord.x/screenX - 0.5) * zPos);
+ fW.xyz+= camY * ((gl_FragCoord.y/screenY- 0.5) * zPos );
//fW.y-=camLoc.y;
return fW;
@@ -194,10 +195,6 @@ vec4 shadowMapping(){
return myLight;
}
-
-
-
- //vec4 pixelPosition=texture2D(pickTex,texCoord );
vec4 pixelPosition=fragWorldLoc;
pixelPosition.w=1.0;
@@ -207,6 +204,8 @@ vec4 shadowMapping(){
vec4 shadowCoord = lightProjectionMatrix * lightViewMatrix * pixelPosition ;
vec4 ssShadow=shadowCoord/shadowCoord.w;
+
+
ssShadow=ssShadow * 0.5 + 0.5;
ssShadow.xy = ssShadow.xy;
@@ -215,8 +214,8 @@ vec4 shadowMapping(){
//this leads to hard edges. Maybe we can soften them up a bit?
- vec4 shadowColor=blur3(shadowTex, ssShadow.xy );
- //vec4 shadowColor=texture2D(shadowTex, ssShadow.xy);
+ //vec4 shadowColor=blur3(shadowTex, ssShadow.xy );
+ vec4 shadowColor=texture2D(shadowTex, ssShadow.xy);
float falloff = (shadowCoord.z) - shadowColor.x;
//myLight +=max(0.0,(1.0 - falloff)) * computeLight();
//myLight += computeLight();
@@ -239,7 +238,7 @@ void main(){
fragWorldLoc=calcFragmentWorldSpace();
//load old lighting data
- gl_FragColor=texture2D(tex, texCoord * lighting_size/scene_size);
+ gl_FragColor=texture2D(tex, texCoord);
//gl_FragColor=vec4(0.0,0.0,0.0,1.0);
//gl_FragColor+=computeLight();
gl_FragColor+=shadowMapping();
View
1  shaders/post/dof.frag
@@ -175,6 +175,7 @@ vec4 computeDOF() {
void main(void){
gl_FragColor=computeDOF();
+ //gl_FragDepth=texture2D(depthTex,texCoord).r;
gl_FragColor.a=1.0;
}
View
4 shaders/post/post.frag
@@ -252,7 +252,7 @@ void main(void){
///regular shadows
//if we have negative values in our first channel, we are unlit!
if (bLighting){// && !bSmudge){
- vec4 lightData=texture2D(shadowTex,texCoord * lighting_size/scene_size);
+ vec4 lightData=texture2D(shadowTex,texCoord);
//vec4 lightData=texture2D(shadowTex,texCoord);
gl_FragData[0]*=lightData;
}
@@ -260,6 +260,8 @@ void main(void){
///Ambient Occlusion
if (bSSAO)
gl_FragData[0].rgb*=computeAO().rgb ;
+
+ gl_FragDepth=texture2D(pickTex,texCoord).r;
///debug stuff
//gl_FragData[0]/=3.0;
View
2  shaders/skeletal.vert
@@ -92,7 +92,7 @@ void main(){
gl_Position=myPosition;
//Point Size
- gl_PointSize=pointSize() * screensize/scene_size;
+ gl_PointSize=pointSize();
//make unskinned particles go away!
//if (bones[0]<0)
View
2  shaders/skeletalCab.vert
@@ -100,7 +100,7 @@ void main(){
float myTime=time;
//Point Size
- gl_PointSize= pointSize() * (1.45+0.45* cos(0.00031* myTime + objectID +xC +myVertex.y)) * screensize/scene_size;
+ gl_PointSize= pointSize() * (1.45+0.45* cos(0.00031* myTime + objectID +xC +myVertex.y));
//smudging and pixel Position
smudge=gl_NormalMatrix * gl_SecondaryColor.rgb;
View
2  shaders/skeletalIllustration.vert
@@ -100,7 +100,7 @@ void main(){
float myTime=time;
//Point Size
- gl_PointSize= pointSize() * (1.45+0.45* cos(0.00031* myTime + objectID +xC +myVertex.y)) * screensize/scene_size;
+ gl_PointSize= pointSize() * (1.45+0.45* cos(0.00031* myTime + objectID +xC +myVertex.y));
//smudging and pixel Position
smudge=gl_NormalMatrix * gl_SecondaryColor.rgb;
View
2  shaders/skinning.vert
@@ -96,7 +96,7 @@ void main(){
//apply bone transformations
gl_Position=gl_ProjectionMatrix * gl_ModelViewMatrix * myVertex;
- gl_PointSize= pointSize() * screensize/scene_size * (45.0*45.0)/(fov*fov);
+ gl_PointSize= pointSize() * (45.0*45.0)/(fov*fov);
zPos=gl_Position.z;
View
2  shaders/texture.vert
@@ -51,7 +51,7 @@ void main(){
//vec4 myPos = gl_ModelViewMatrix * myVertex;
//myPos=myPos/myPos.w;
- gl_PointSize= pointSize() * screensize/scene_size;
+ gl_PointSize= pointSize();
//zPos from 0 to 1, then from 0 to 65536.0!
zPos=gl_Position.z;
View
BIN  tools/msbKinect/msbKinect.exe
Binary file not shown
View
6 tools/msbKinect/userConfig.xml
@@ -10,9 +10,9 @@
<BLIGHT>bool 0</BLIGHT>
<BPICKABLE>bool 1</BPICKABLE>
<BSENDSKELETON>bool 0</BSENDSKELETON>
- <BSETCUTOFFTOZERO>bool 0</BSETCUTOFFTOZERO>
+ <BSETCUTOFFTOZERO>bool 1</BSETCUTOFFTOZERO>
<BSHADOWTEXTURED>bool 0</BSHADOWTEXTURED>
- <BSHAREMEMORY>bool 0</BSHAREMEMORY>
+ <BSHAREMEMORY>bool 1</BSHAREMEMORY>
<BTEXTURED>bool 0</BTEXTURED>
<BUSESHADER>bool 1</BUSESHADER>
<BUSETRANSFORMMATRIX>bool 1</BUSETRANSFORMMATRIX>
@@ -20,7 +20,7 @@
<BZWRITE>bool 1</BZWRITE>
<CHANNEL>int 1</CHANNEL>
<COLOR>vec4f 1.000000 1.000000 1.000000 1.000000</COLOR>
- <CUTOFFDEPTH>float 4096.000000</CUTOFFDEPTH>
+ <CUTOFFDEPTH>float 2048.000000</CUTOFFDEPTH>
<DRAWTYPE>int 2</DRAWTYPE>
<GROUPID>string NULL</GROUPID>
<IPADDRESS>string 127.0.1.1</IPADDRESS>
Please sign in to comment.
Something went wrong with that request. Please try again.