Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: GAME engine + non-polygonal 3d collision detection project

  1. #11

    GAME engine + non-polygonal 3d collision detection project

    looks good, you are developing only the engine or a game?
    From brazil (:

    Pascal pownz!

  2. #12

    GAME engine + non-polygonal 3d collision detection project

    only the engine

    I want develop game engine and better graphics engine. First make some tech demos and then maybe start some real game project.

  3. #13

    GAME engine + non-polygonal 3d collision detection project

    v 2008/4/7
    - added TBN support
    - added parallax mapping example
    - added temporary uvscalehack global variable
    - fixed ssao shader


  4. #14

    GAME engine + non-polygonal 3d collision detection project

    Depth Corrected Parallax Mapping shader for TDG3D:
    Code:
    [VP test]
    
    varying vec3 lightVec; 
    varying vec3 eyeVec;
    varying vec3 et;
    
    varying vec3    V_M;
    varying vec4    glVertex;
    varying vec2    glTexCoord0;
    
    //*> TBNtangent Tangent
    attribute vec3 Tangent;
    
    //*> TBNnormal Normal
    attribute vec3 Normal;
    
    //*> TBNbinormal BiNormal
    attribute vec3 BiNormal;
    
    
    mat3 glNormalMatrixInverse(void)
    {
      return mat3(  gl_ModelViewMatrix[0][0], gl_ModelViewMatrix[1][0], gl_ModelViewMatrix[2][0], 
              gl_ModelViewMatrix[0][1], gl_ModelViewMatrix[1][1], gl_ModelViewMatrix[2][1], 
              gl_ModelViewMatrix[0][2], gl_ModelViewMatrix[1][2], gl_ModelViewMatrix[2][2]  );
    }
    
    void main(void)
    {
    
      glTexCoord0 = gl_MultiTexCoord0.st;
      glVertex = gl_Vertex;
    
      V_M = normalize(-glNormalMatrixInverse() * gl_ModelViewMatrix[3].xyz - glVertex.xyz);
    
      gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
    
      vec3 t = normalize(gl_NormalMatrix * Tangent);
      vec3 b = normalize(gl_NormalMatrix * BiNormal);
      vec3 n = normalize(gl_NormalMatrix * Normal);
      
      vec3 vVertex = vec3(gl_ModelViewMatrix * gl_Vertex);
      
      vec3 tmpVec = gl_LightSource[0].position.xyz - vVertex;
    
      lightVec.x = dot(tmpVec, t);
      lightVec.y = dot(tmpVec, b);
      lightVec.z = dot(tmpVec, n);
    
      tmpVec = -vVertex;
      eyeVec.x = dot(tmpVec, t);
      eyeVec.y = dot(tmpVec, b);
      eyeVec.z = dot(tmpVec, n);
    }
    
    
    
    [FP test]
    
    
    //*> sampler2D 0 colorMap
    uniform sampler2D colorMap;
    
    //*> sampler2D 1 heightMap
    uniform sampler2D heightMap;
    
    //*> sampler2D 2 normalMap
    uniform sampler2D normalMap;
    
    
    varying vec3 lightVec;
    varying vec3 eyeVec;
    
    varying vec3    V_M;
    varying vec4    glVertex;
    varying vec2    glTexCoord0;
    
    const float howmuch = 1.5;
    const float invRadius = 0.0005;
    
    void main (void)
    {
    
            float distSqr = dot(lightVec, lightVec);
      float att = clamp(1.0 - invRadius * sqrt(distSqr), 0.0, 1.0);
      vec3 lVec = lightVec * inversesqrt(distSqr);
    
      vec3 vVec = normalize(eyeVec);
    
      float height = texture2D ( heightMap, glTexCoord0.xy ).b; 
      float h    = 0.03 * (1.0-height) - 0.015;
    
      vec2 tex  = glTexCoord0.xy - vVec.xy * h * howmuch / vVec.z;
      
      vec4 base = texture2D(colorMap, tex);
      
      vec3 bump = normalize( texture2D(normalMap, tex).xyz * 2.0 - 1.0);
    
      float diffuse = max( dot(lVec, bump), 0.0 );
    
      vec4 vertex = glVertex + vec4(2.0*height * V_M, 0.0);
      vec4 p = gl_ModelViewProjectionMatrix * vertex;
    
    
      gl_FragColor = vec4( base.rgb*diffuse*att,1.0 );
    
      gl_FragDepth = 0.5 * (p.z / p.w + 1.0);
    
    }
    This shader alters OpenGL depth buffer to make parallax effect more realistic. Enjoy!

  5. #15

    GAME engine + non-polygonal 3d collision detection project

    Screenshots?...
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  6. #16

    GAME engine + non-polygonal 3d collision detection project

    The downloads all don't work?

    Is there a mesh to mesh collision function included?

    Thanks,
    firle

    PS: Could download it now from the website. Interesting stuff. Too bad all the comments are in russian. And too bad it is OpenGL, but thanks anyway

  7. #17

    GAME engine + non-polygonal 3d collision detection project

    Yes, functions included:

    ObjectToLevelCollision(0,1, variablesElapsedTime);
    ObjectToLevelCollision(2,1, variablesElapsedTime);

    ObjectToObjectCollision(0,2);

    0,2 - object1,object2
    1 - level

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •