Results 1 to 4 of 4

Thread: Use only fragment shader

  1. #1
    Lesser Knight
    Join Date
    May 2010
    Posts
    32

    Default Use only fragment shader

    Hi, all.

    Who can show me simple example where CL used only fragment shaders?
    (CL_ProgramObject::load can load only fs)

    Very big thnx!

    P.s. plz dont ignore me =(

  2. #2
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    Not sure I understand what you are looking for. Have you looked at the examples in Examples\Display_Shaders ? Some of them are pretty small.

  3. #3
    Lesser Knight
    Join Date
    May 2010
    Posts
    32

    Default

    Quote Originally Posted by sphair View Post
    Not sure I understand what you are looking for. Have you looked at the examples in Examples\Display_Shaders ? Some of them are pretty small.
    All examples in Examples\Display_Shaders used vertex shaders and fragment shaders. But CL_ProgramObject can load only FS. Why i can used only FS without VS in CL?

  4. #4
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Fragment shaders will not work without vertex shaders.

    We define our own uniforms, for example: cl_ModelViewProjectionMatrix.

    The vertex shader uses this to write gl_position.

    It would be impossible for OpenGL to guess what to do with "cl_ModelViewProjectionMatrix"

    In the past, OpenGL 2.1 used gl_ModelViewProjectionMatrix. But not any more.

Similar Threads

  1. Updated Geometry Shader Example
    By rombust in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 02-09-2012, 08:17 PM
  2. Night Vision Shader Example
    By rombust in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 06-25-2011, 12:51 PM
  3. GLSL example geometry shader
    By rombust in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 03-10-2010, 02:13 PM
  4. New Geometry Shader Example
    By rombust in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 03-08-2010, 03:16 PM
  5. Shader Help
    By jerkald in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 09-07-2008, 09:54 PM

Bookmarks

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
  •