Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Confused about Frustrum and Vertex Shader

Threaded View

  1. #1
    Intern Contributor uwi2k2's Avatar
    Join Date
    Mar 2011
    Posts
    98

    Confused about Frustrum and Vertex Shader

    ---- solved ----


    Hi all,

    i allready work with shaders for some time, but today i am totally confused about a strange beavior.
    I just strted a new opengl project and implemented a simple shader pair...
    I was getting no visible result so i started testing around ..

    In my new setup Project i only get visible output when i set 'gl_Position.z' between -1 and 1
    Code :
    ...// vertex shader last line
     gl_Position.z = -0.2 ; // << works
    gl_Position.z = -1.2 ; // << does not work
    ....

    BUT in one of my other Projects i can use larger values and still see the output.
    Code :
    ...// vertex shader last line
     gl_Position.z = -0.2 ; // << works
    gl_Position.z = -8.2 ; // << works as well
    ....

    I donīt understand why, cause as i use my onw Programm( shader pair ) and my own matrix fpr perspective
    the opengl frustrum or any other global state should not have any effect on the visible range ( near / far clipping plane ).

    Do in need to set a Frustum when i use shader and my own matrix ?

    Can anyone tell me what i am doing wrong ??
    What is my mistake - have i missunderstood something ??

    thanx a lot !!
    uwi

    (edit) sorry i just spent 5 min away from the pc and now its all obvious to me.... question solved !
    Last edited by uwi2k2; 02-07-2013 at 10:02 AM.
    uwi2k2 - OpenGL Trainer: www.opengl-trainer.com
    ---------------------------------------------------------
    Free Programming Helpline: www.programming-hotline.com
    ---------------------------------------------------------
    A Friday Night Programmer: www.uwiworld.net

Posting Permissions

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