diff --git a/KREngine/KREngine.xcodeproj/project.pbxproj b/KREngine/KREngine.xcodeproj/project.pbxproj index 30853e2..a69e1eb 100644 --- a/KREngine/KREngine.xcodeproj/project.pbxproj +++ b/KREngine/KREngine.xcodeproj/project.pbxproj @@ -144,6 +144,8 @@ E4BBBB9E1512A4AE00F43B5B /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4BBBB961512A46700F43B5B /* AppKit.framework */; }; E4BBBB9F1512A4B100F43B5B /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4BBBB941512A45500F43B5B /* Cocoa.framework */; }; E4BBBBA71512A6DC00F43B5B /* KRVector3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E491017F13C99BDC0098455B /* KRVector3.cpp */; }; + E4CE184D15FF124600F80870 /* light_point_inside.fsh in Sources */ = {isa = PBXBuildFile; fileRef = E4CE184C15FF124600F80870 /* light_point_inside.fsh */; }; + E4CE184F15FF125700F80870 /* light_point_inside.vsh in Sources */ = {isa = PBXBuildFile; fileRef = E4CE184E15FF125700F80870 /* light_point_inside.vsh */; }; E4D0683F1512A790005FFBEB /* KRVector3.h in Headers */ = {isa = PBXBuildFile; fileRef = E491017E13C99BDC0098455B /* KRVector3.h */; settings = {ATTRIBUTES = (Public, ); }; }; E4D13364153767ED0070068C /* KRShaderManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47C25A613F4F6AB00FF4370 /* KRShaderManager.cpp */; settings = {ATTRIBUTES = (Public, ); }; }; E4D13365153767FF0070068C /* KRShaderManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E47C25A113F4F65A00FF4370 /* KRShaderManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -297,6 +299,8 @@ E4BBBB981512A47500F43B5B /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/CoreData.framework; sourceTree = DEVELOPER_DIR; }; E4BBBB9A1512A48200F43B5B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; E4CE184815FEEDA200F80870 /* font.pvr */ = {isa = PBXFileReference; lastKnownFileType = file; name = font.pvr; path = Shaders/font.pvr; sourceTree = ""; }; + E4CE184C15FF124600F80870 /* light_point_inside.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = light_point_inside.fsh; path = Shaders/light_point_inside.fsh; sourceTree = ""; }; + E4CE184E15FF125700F80870 /* light_point_inside.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = light_point_inside.vsh; path = Shaders/light_point_inside.vsh; sourceTree = ""; }; E4D133B91538F7480070068C /* light_directional.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = light_directional.fsh; path = Shaders/light_directional.fsh; sourceTree = ""; }; E4D133BB1538F7560070068C /* light_directional.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = light_directional.vsh; path = Shaders/light_directional.vsh; sourceTree = ""; }; E4F711A41512BB56007EE923 /* libfbxsdk-2012.2-static.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libfbxsdk-2012.2-static.a"; path = "../../../../../../../../Applications/Autodesk/FBXSDK20122/lib/gcc4/ub/libfbxsdk-2012.2-static.a"; sourceTree = ""; }; @@ -351,6 +355,8 @@ E430D08015F8882F0010558D /* occlusion_test.fsh */, E430D08815F88AD10010558D /* occlusion_test.vsh */, E48839A015F92C2800BD66D5 /* visualize_overlay.fsh */, + E4CE184C15FF124600F80870 /* light_point_inside.fsh */, + E4CE184E15FF125700F80870 /* light_point_inside.vsh */, ); name = Shaders; sourceTree = ""; @@ -860,6 +866,8 @@ E488399415F928CA00BD66D5 /* KRBundle.cpp in Sources */, E488399C15F92BE000BD66D5 /* KRBundleManager.cpp in Sources */, E48839A115F92C2800BD66D5 /* visualize_overlay.fsh in Sources */, + E4CE184D15FF124600F80870 /* light_point_inside.fsh in Sources */, + E4CE184F15FF125700F80870 /* light_point_inside.vsh in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/KREngine/KREngine/Classes/KRDataBlock.cpp b/KREngine/KREngine/Classes/KRDataBlock.cpp index 825569e..9814793 100644 --- a/KREngine/KREngine/Classes/KRDataBlock.cpp +++ b/KREngine/KREngine/Classes/KRDataBlock.cpp @@ -55,9 +55,7 @@ void KRDataBlock::unload() { if(m_fdPackFile) { // Memory mapped file - if(m_bMalloced) { - munmap(m_data, m_data_size); - } + munmap(m_data, m_data_size); close(m_fdPackFile); } else if(m_data != NULL && m_bMalloced) { // Malloc'ed data diff --git a/KREngine/KREngine/Classes/KRMesh.cpp b/KREngine/KREngine/Classes/KRMesh.cpp index c950bad..f217124 100644 --- a/KREngine/KREngine/Classes/KRMesh.cpp +++ b/KREngine/KREngine/Classes/KRMesh.cpp @@ -102,7 +102,7 @@ vector KRMesh::getSubmeshes() { return m_submeshes; } -void KRMesh::renderSubmesh(int iSubmesh, int *iPrevBuffer) { +void KRMesh::renderSubmesh(int iSubmesh, int &iPrevBuffer) { VertexData *pVertexData = getVertexData(); // // if(m_cBuffers == 0) { @@ -130,11 +130,11 @@ void KRMesh::renderSubmesh(int iSubmesh, int *iPrevBuffer) { iVertex = iVertex % MAX_VBO_SIZE; int cVertexes = pSubmesh->vertex_count; while(cVertexes > 0) { - //if(*iPrevBuffer != iBuffer) { + if(iPrevBuffer != iBuffer) { GLsizei cBufferVertexes = iBuffer < cBuffers - 1 ? MAX_VBO_SIZE : pHeader->vertex_count % MAX_VBO_SIZE; m_pContext->getModelManager()->bindVBO(pVertexData + iBuffer * MAX_VBO_SIZE, sizeof(VertexData) * cBufferVertexes); - if(*iPrevBuffer == -1) { + if(iPrevBuffer == -1) { glEnableVertexAttribArray(KRShader::KRENGINE_ATTRIB_VERTEX); glEnableVertexAttribArray(KRShader::KRENGINE_ATTRIB_NORMAL); glEnableVertexAttribArray(KRShader::KRENGINE_ATTRIB_TANGENT); @@ -150,8 +150,8 @@ void KRMesh::renderSubmesh(int iSubmesh, int *iPrevBuffer) { glVertexAttribPointer(KRShader::KRENGINE_ATTRIB_TANGENT, 3, GL_FLOAT, 0, data_size, BUFFER_OFFSET(sizeof(KRVector3D) * 2)); glVertexAttribPointer(KRShader::KRENGINE_ATTRIB_TEXUVA, 2, GL_FLOAT, 0, data_size, BUFFER_OFFSET(sizeof(KRVector3D) * 3)); glVertexAttribPointer(KRShader::KRENGINE_ATTRIB_TEXUVB, 2, GL_FLOAT, 0, data_size, BUFFER_OFFSET(sizeof(KRVector3D) * 3 + sizeof(TexCoord))); - //} - *iPrevBuffer = iBuffer; + } + iPrevBuffer = iBuffer; if(iVertex + cVertexes >= MAX_VBO_SIZE) { glDrawArrays(GL_TRIANGLES, iVertex, (MAX_VBO_SIZE - iVertex)); diff --git a/KREngine/KREngine/Classes/KRMesh.h b/KREngine/KREngine/Classes/KRMesh.h index a7aab64..2d7073b 100644 --- a/KREngine/KREngine/Classes/KRMesh.h +++ b/KREngine/KREngine/Classes/KRMesh.h @@ -69,7 +69,7 @@ public: void loadPack(KRDataBlock *data); - void renderSubmesh(int iSubmesh, int *iPrevBuffer); + void renderSubmesh(int iSubmesh, int &iPrevBuffer); GLfloat getMaxDimension(); diff --git a/KREngine/KREngine/Classes/KRModel.cpp b/KREngine/KREngine/Classes/KRModel.cpp index fc3f76f..6cf58d4 100644 --- a/KREngine/KREngine/Classes/KRModel.cpp +++ b/KREngine/KREngine/Classes/KRModel.cpp @@ -103,7 +103,7 @@ void KRModel::render(KRCamera *pCamera, KRContext *pContext, KRMat4 &matModelToV if(!pMaterial->isTransparent()) { // Exclude transparent and semi-transparent meshes from shadow maps - m_pMesh->renderSubmesh(iSubmesh, &iPrevBuffer); + m_pMesh->renderSubmesh(iSubmesh, iPrevBuffer); } } @@ -121,19 +121,19 @@ void KRModel::render(KRCamera *pCamera, KRContext *pContext, KRMat4 &matModelToV switch(pMaterial->getAlphaMode()) { case KRMaterial::KRMATERIAL_ALPHA_MODE_OPAQUE: // Non-transparent materials case KRMaterial::KRMATERIAL_ALPHA_MODE_TEST: // Alpha in diffuse texture is interpreted as punch-through when < 0.5 - m_pMesh->renderSubmesh(iSubmesh, &iPrevBuffer); + m_pMesh->renderSubmesh(iSubmesh, iPrevBuffer); break; case KRMaterial::KRMATERIAL_ALPHA_MODE_BLENDONESIDE: // Blended alpha with backface culling - m_pMesh->renderSubmesh(iSubmesh, &iPrevBuffer); + m_pMesh->renderSubmesh(iSubmesh, iPrevBuffer); break; case KRMaterial::KRMATERIAL_ALPHA_MODE_BLENDTWOSIDE: // Blended alpha rendered in two passes. First pass renders backfaces; second pass renders frontfaces. // Render back faces first glCullFace(GL_BACK); - m_pMesh->renderSubmesh(iSubmesh, &iPrevBuffer); + m_pMesh->renderSubmesh(iSubmesh, iPrevBuffer); // Render front faces second glCullFace(GL_BACK); - m_pMesh->renderSubmesh(iSubmesh, &iPrevBuffer); + m_pMesh->renderSubmesh(iSubmesh, iPrevBuffer); break; } diff --git a/KREngine/KREngine/Classes/KRModelManager.cpp b/KREngine/KREngine/Classes/KRModelManager.cpp index b9731ee..f510c84 100644 --- a/KREngine/KREngine/Classes/KRModelManager.cpp +++ b/KREngine/KREngine/Classes/KRModelManager.cpp @@ -66,13 +66,11 @@ std::map KRModelManager::getModels() { } void KRModelManager::bindVBO(const GLvoid *data, GLsizeiptr size) { - assert(size > 0); if(m_currentVBO.data != data || m_currentVBO.size != size) { if(m_vbos.find(data) != m_vbos.end()) { m_currentVBO = m_vbos[data]; - assert(m_currentVBO.size == size); glBindBuffer(GL_ARRAY_BUFFER, m_currentVBO.handle); } else { m_vboMemUsed += size; diff --git a/KREngine/KREngine/Classes/KRPointLight.cpp b/KREngine/KREngine/Classes/KRPointLight.cpp index e4e1e58..09605b6 100644 --- a/KREngine/KREngine/Classes/KRPointLight.cpp +++ b/KREngine/KREngine/Classes/KRPointLight.cpp @@ -74,7 +74,11 @@ void KRPointLight::render(KRCamera *pCamera, KRContext *pContext, KRBoundingVolu if(influence_extents.test_intersect(frustrumVolumeNoNearClip)) { // Cull out any lights not within the view frustrum - KRShader *pShader = pContext->getShaderManager()->getShader("light_point", pCamera, false, false, false, 0, false, false, false, false, false, false, false, false, false, renderPass); + KRVector3 view_light_position = KRMat4::Dot(viewMatrix, light_position); + + bool bInsideLight = view_light_position.sqrMagnitude() <= (influence_radius + pCamera->perspective_nearz) * (influence_radius + pCamera->perspective_nearz); + + KRShader *pShader = pContext->getShaderManager()->getShader(bInsideLight ? "light_point_inside" : "light_point", pCamera, false, false, false, 0, false, false, false, false, false, false, false, false, false, renderPass); pShader->bind(pCamera, matModelToView, mvpmatrix, cameraPosition, lightDirection, pShadowMatrices, shadowDepthTextures, 0, renderPass); glUniform3f( pShader->m_uniforms[KRShader::KRENGINE_UNIFORM_LIGHT_COLOR], @@ -122,22 +126,40 @@ void KRPointLight::render(KRCamera *pCamera, KRContext *pContext, KRBoundingVolu matInvProjection.invert(); glUniformMatrix4fv(pShader->m_uniforms[KRShader::KRENGINE_UNIFORM_INVP], 1, GL_FALSE, matInvProjection.getPointer()); - // Disable z-buffer write glDepthMask(GL_FALSE); - // Render sphere of light's influence - generateMesh(); - - // Enable z-buffer test - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LEQUAL); - glDepthRangef(0.0, 1.0); + if(bInsideLight) { + + // Disable z-buffer test + glDisable(GL_DEPTH_TEST); + + // Render a full screen quad + static const GLfloat squareVertices[] = { + -1.0f, -1.0f, + 1.0f, -1.0f, + -1.0f, 1.0f, + 1.0f, 1.0f, + }; + + glBindBuffer(GL_ARRAY_BUFFER, 0); + glVertexAttribPointer(KRShader::KRENGINE_ATTRIB_VERTEX, 2, GL_FLOAT, 0, 0, squareVertices); + glEnableVertexAttribArray(KRShader::KRENGINE_ATTRIB_VERTEX); + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + } else { + // Render sphere of light's influence + generateMesh(); - glBindBuffer(GL_ARRAY_BUFFER, 0); - glVertexAttribPointer(KRShader::KRENGINE_ATTRIB_VERTEX, 3, GL_FLOAT, 0, 0, m_sphereVertices); - glEnableVertexAttribArray(KRShader::KRENGINE_ATTRIB_VERTEX); - glDrawArrays(GL_TRIANGLES, 0, m_cVertices); + // Enable z-buffer test + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LEQUAL); + glDepthRangef(0.0, 1.0); + + glBindBuffer(GL_ARRAY_BUFFER, 0); + glVertexAttribPointer(KRShader::KRENGINE_ATTRIB_VERTEX, 3, GL_FLOAT, 0, 0, m_sphereVertices); + glEnableVertexAttribArray(KRShader::KRENGINE_ATTRIB_VERTEX); + glDrawArrays(GL_TRIANGLES, 0, m_cVertices); + } } } } diff --git a/KREngine/KREngine/Classes/KRScene.cpp b/KREngine/KREngine/Classes/KRScene.cpp index 59bb531..2d6ae64 100644 --- a/KREngine/KREngine/Classes/KRScene.cpp +++ b/KREngine/KREngine/Classes/KRScene.cpp @@ -158,6 +158,7 @@ void KRScene::render(KROctreeNode *pOctreeNode, std::set &visibleBounds, pOctreeNode->beginOcclusionQuery(renderPass == KRNode::RENDER_PASS_FORWARD_TRANSPARENT); } + // Occlusion test indicates that this bounding box was visible in the last frame for(std::set::iterator itr=pOctreeNode->getSceneNodes().begin(); itr != pOctreeNode->getSceneNodes().end(); itr++) { //assert(pOctreeNode->getBounds().contains((*itr)->getBounds())); // Sanity check diff --git a/KREngine/KREngine/Classes/KRTexture.cpp b/KREngine/KREngine/Classes/KRTexture.cpp index 4658750..94d7dee 100644 --- a/KREngine/KREngine/Classes/KRTexture.cpp +++ b/KREngine/KREngine/Classes/KRTexture.cpp @@ -165,16 +165,16 @@ bool KRTexture::createGLTexture() { int width = m_iWidth; int height = m_iHeight; GLenum err; + + if(m_blocks.size() == 0) { + return false; + } - if (m_blocks.size() > 0) - { - if (m_iName != 0) { - glDeleteTextures(1, &m_iName); - } - - glGenTextures(1, &m_iName); - glBindTexture(GL_TEXTURE_2D, m_iName); - } + glGenTextures(1, &m_iName); + if(m_iName == 0) { + return false; + } + glBindTexture(GL_TEXTURE_2D, m_iName); if (m_blocks.size() > 1) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); @@ -188,6 +188,8 @@ bool KRTexture::createGLTexture() { err = glGetError(); if (err != GL_NO_ERROR) { + glDeleteTextures(1, &m_iName); + m_iName = 0; return false; } @@ -216,7 +218,7 @@ GLuint KRTexture::getHandle(long &textureMemUsed) { textureMemUsed += getMemSize(); } - createGLTexture(); + //createGLTexture(); } return m_iName; } diff --git a/KREngine/KREngine/Classes/KRTextureManager.cpp b/KREngine/KREngine/Classes/KRTextureManager.cpp index 9782302..7f34a77 100644 --- a/KREngine/KREngine/Classes/KRTextureManager.cpp +++ b/KREngine/KREngine/Classes/KRTextureManager.cpp @@ -30,6 +30,7 @@ // #include "KRTextureManager.h" +#include "KRContext.h" #include KRTextureManager::KRTextureManager(KRContext &context) : KRContextObject(context) { diff --git a/KREngine/KREngine/Shaders/light_point_inside.fsh b/KREngine/KREngine/Shaders/light_point_inside.fsh new file mode 100644 index 0000000..844e3ed --- /dev/null +++ b/KREngine/KREngine/Shaders/light_point_inside.fsh @@ -0,0 +1,73 @@ +// Copyright 2012 Kearwood Gilbert. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEARWOOD GILBERT OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and documentation are those of the +// authors and should not be interpreted as representing official policies, either expressed +// or implied, of Kearwood Gilbert. +// + + +uniform sampler2D gbuffer_frame; +uniform sampler2D gbuffer_depth; + +uniform lowp vec3 light_color; +uniform highp float light_intensity; +uniform highp float light_decay_start; +uniform highp float light_cutoff; +uniform mediump vec4 viewport; + +uniform highp mat4 inv_projection_matrix; + +uniform highp vec3 view_space_light_position; + +void main() +{ + + lowp vec2 gbuffer_uv = vec2(gl_FragCoord.xy / viewport.zw); + lowp vec4 gbuffer_sample = texture2D(gbuffer_frame, gbuffer_uv); + + mediump vec3 gbuffer_normal = normalize(2.0 * gbuffer_sample.rgb - 1.0); + mediump float gbuffer_specular_exponent = gbuffer_sample.a * 100.0; + + mediump vec4 clip_space_vertex_position = vec4( + gl_FragCoord.xy / viewport.zw * 2.0 - 1.0, + texture2D(gbuffer_depth, gbuffer_uv).r * 2.0 - 1.0, + 1.0 + ); + + + mediump vec4 view_space_vertex_position = inv_projection_matrix * clip_space_vertex_position; + view_space_vertex_position.xyz /= view_space_vertex_position.w; + + mediump float light_distance = max(0.0, distance(view_space_light_position.xyz, view_space_vertex_position.xyz) - light_decay_start); + mediump float light_attenuation = (light_intensity / ((light_distance + 1.0) * (light_distance + 1.0)) - light_cutoff) / (1.0 - light_cutoff); + mediump vec3 light_vec = normalize(view_space_light_position.xyz - view_space_vertex_position.xyz); + mediump float lamberFactor = dot(light_vec, gbuffer_normal) * 0.2; + + mediump float specularFactor = 0.0; + //if(gbuffer_specular_exponent > 0.0) { + mediump vec3 halfVec = normalize((normalize(- view_space_vertex_position.xyz) + light_vec)); + specularFactor = pow(dot(halfVec,gbuffer_normal), gbuffer_specular_exponent); + //} + + gl_FragColor = vec4(light_color * lamberFactor, specularFactor) * light_attenuation; +} diff --git a/KREngine/KREngine/Shaders/light_point_inside.vsh b/KREngine/KREngine/Shaders/light_point_inside.vsh new file mode 100644 index 0000000..62c7fd9 --- /dev/null +++ b/KREngine/KREngine/Shaders/light_point_inside.vsh @@ -0,0 +1,33 @@ +// Copyright 2012 Kearwood Gilbert. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEARWOOD GILBERT OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and documentation are those of the +// authors and should not be interpreted as representing official policies, either expressed +// or implied, of Kearwood Gilbert. +// + +attribute vec4 vertex_position; + +void main() +{ + gl_Position = vertex_position; +} \ No newline at end of file diff --git a/objview/KRObjView.xcodeproj/project.pbxproj b/objview/KRObjView.xcodeproj/project.pbxproj index 5d9cc3c..802ec4e 100644 --- a/objview/KRObjView.xcodeproj/project.pbxproj +++ b/objview/KRObjView.xcodeproj/project.pbxproj @@ -42,6 +42,10 @@ E4A9DEC715412923009DF363 /* light_point.fsh in Resources */ = {isa = PBXBuildFile; fileRef = E4A9DEC2154128F0009DF363 /* light_point.fsh */; }; E4A9DEC815412923009DF363 /* light_point.vsh in Resources */ = {isa = PBXBuildFile; fileRef = E4A9DEC515412906009DF363 /* light_point.vsh */; }; E4CE184A15FEEE8500F80870 /* font.pvr in Resources */ = {isa = PBXBuildFile; fileRef = E4CE184915FEEE8500F80870 /* font.pvr */; }; + E4CE185215FF12A700F80870 /* light_point_inside.fsh in Sources */ = {isa = PBXBuildFile; fileRef = E4CE185015FF12A700F80870 /* light_point_inside.fsh */; }; + E4CE185315FF12A700F80870 /* light_point_inside.vsh in Sources */ = {isa = PBXBuildFile; fileRef = E4CE185115FF12A700F80870 /* light_point_inside.vsh */; }; + E4CE185415FF12B700F80870 /* light_point_inside.fsh in Resources */ = {isa = PBXBuildFile; fileRef = E4CE185015FF12A700F80870 /* light_point_inside.fsh */; }; + E4CE185515FF12B700F80870 /* light_point_inside.vsh in Resources */ = {isa = PBXBuildFile; fileRef = E4CE185115FF12A700F80870 /* light_point_inside.vsh */; }; E4FF48C51538FBF8002053FC /* light_directional.fsh in Resources */ = {isa = PBXBuildFile; fileRef = E4FF48C01538FBF0002053FC /* light_directional.fsh */; }; E4FF48C61538FBFC002053FC /* light_directional.vsh in Resources */ = {isa = PBXBuildFile; fileRef = E4FF48C11538FBF0002053FC /* light_directional.vsh */; }; /* End PBXBuildFile section */ @@ -86,6 +90,8 @@ E4A9DEC2154128F0009DF363 /* light_point.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = light_point.fsh; path = ../KREngine/KREngine/Shaders/light_point.fsh; sourceTree = ""; }; E4A9DEC515412906009DF363 /* light_point.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = light_point.vsh; path = ../KREngine/KREngine/Shaders/light_point.vsh; sourceTree = ""; }; E4CE184915FEEE8500F80870 /* font.pvr */ = {isa = PBXFileReference; lastKnownFileType = file; name = font.pvr; path = ../KREngine/KREngine/Shaders/font.pvr; sourceTree = ""; }; + E4CE185015FF12A700F80870 /* light_point_inside.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = light_point_inside.fsh; path = ../KREngine/KREngine/Shaders/light_point_inside.fsh; sourceTree = ""; }; + E4CE185115FF12A700F80870 /* light_point_inside.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = light_point_inside.vsh; path = ../KREngine/KREngine/Shaders/light_point_inside.vsh; sourceTree = ""; }; E4FF48C01538FBF0002053FC /* light_directional.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = light_directional.fsh; path = ../KREngine/KREngine/Shaders/light_directional.fsh; sourceTree = ""; }; E4FF48C11538FBF0002053FC /* light_directional.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = light_directional.vsh; path = ../KREngine/KREngine/Shaders/light_directional.vsh; sourceTree = ""; }; /* End PBXFileReference section */ @@ -202,6 +208,8 @@ E46FED2013C9A472009F5814 /* Shaders */ = { isa = PBXGroup; children = ( + E4CE185015FF12A700F80870 /* light_point_inside.fsh */, + E4CE185115FF12A700F80870 /* light_point_inside.vsh */, E48839A315F92C6900BD66D5 /* visualize_overlay.fsh */, E430D08A15F88B950010558D /* occlusion_test.vsh */, E430D08515F88A9F0010558D /* occlusion_test.fsh */, @@ -291,6 +299,8 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + E4CE185415FF12B700F80870 /* light_point_inside.fsh in Resources */, + E4CE185515FF12B700F80870 /* light_point_inside.vsh in Resources */, E48839A515F92C8D00BD66D5 /* visualize_overlay.fsh in Resources */, E4769DF3158A7915004B83AC /* flare.fsh in Resources */, E4769DF4158A7915004B83AC /* flare.vsh in Resources */, @@ -329,6 +339,8 @@ E430D08615F88A9F0010558D /* occlusion_test.fsh in Sources */, E430D08B15F88B950010558D /* occlusion_test.vsh in Sources */, E48839A415F92C6900BD66D5 /* visualize_overlay.fsh in Sources */, + E4CE185215FF12A700F80870 /* light_point_inside.fsh in Sources */, + E4CE185315FF12A700F80870 /* light_point_inside.vsh in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };