Jump to content

DudeAwesome

Members
  • Posts

    541
  • Joined

  • Last visited

Posts posted by DudeAwesome

  1. hey guys I´m reading opengl 4.0 shading cook book to get a feeling for shaders and learn the basics but I fail with my first simple diffuse shader example. thats my code:

     

    Vertex

     

    #version 400
    
    layout (location = 0) in vec3 VertexPosition;
    layout (location = 1) in vec3 VertexNormal;
    out vec3 LightIntensity;
    uniform vec4 LightPosition; // Light position in eye coords.
    uniform vec3 Kd; // Diffuse reflectivity
    uniform vec3 Ld; // Light source intensity
    uniform mat4 ModelViewMatrix;
    uniform mat3 NormalMatrix;
    uniform mat4 ProjectionMatrix;
    uniform mat4 MVP; // Projection * ModelView
    
    void main(){
    
    // Convert normal and position to eye coords
    vec3 tnorm = normalize( NormalMatrix * VertexNormal);
    vec4 eyeCoords = ModelViewMatrix * vec4(VertexPosition,1.0);
    vec3 s = normalize(vec3(LightPosition - eyeCoords));
    // The diffuse shading equation
    LightIntensity = Ld * Kd * max( dot( s, tnorm ), 0.0 );
    // Convert position to clip coordinates and pass along
    gl_Position = MVP * vec4(VertexPosition,1.0);
    }
    

     

     

    Fragment

     

     

    #version 400
    
    in vec3 LightIntensity;
    layout( location = 0 ) out vec4 FragColor;
    void main()
    {
    FragColor = vec4(LightIntensity, 1.0);
    
    }

     

    I attached the shader to a material and to a ground but it is still invisible and the screen is black.

  2. whats your framerate?

     

    @micheal

     

    yougroove have set in his startpost sync to true so vsync should be activated. how this function works and if it give us double or trible buffering i dont know, but yougrooves screen looks like normal vsync off artifacts. do you have more context create or some context functions that maybe influence the vsync?

  3. m(

     

    If what you are trying to say is that you have never seen DLC used as upgrades for software you really haven't been looking very hard, a few apps already do that.

     

    come one! use eyes and please read again the startpost and my post.

     

    he want to UPGRADE from STEAM INDIE LUA to NONSTEAM STANDARD EDITION.

     

    this is not possible on steam your links show me a normal upgrade dlc. we talking about standalone (nonsteam) dlc on steam and this dont exist.

    • Upvote 1
  4. when I try to attach a custom shader to a material without textures (I created some basic shaders like diffuse and ads etc.) and I try to save the material everything gets resetted. I dont know why I waste my time with this. I just wanted to learn some shader stuff and want to use leadwerks but this is also not working...

  5. Finally had some time to take a look at my map. Added

    self.world:SetLightQuality(2)
    

    to app.lua and things look a lot better. I guess I can remedy some of the small areas by breaking up long corridors, or scripting the light to turn off when they reach a certain area.

     

    what is that function? there is no entry in the api in the world class

×
×
  • Create New...