Technical Features

    Joined
    May 27, 2012
    Messages
    19
    Reaction score
    0
    You should add it so that it automatically rotates the view point. For instance, I put a gravity block inside my cargo ship. It worked until I hit the ground. When I hit the ground, the ship moved, the gravity changed, and I couldn't adjust my viewport so it was correct. Another thing is I just wanted to make sure you knew! When two lights shine on a surface, it is not the Light A + Light B. The correct formula is max(Light A, Light B). Thanks!
     

    schema

    Cat God
    Joined
    Feb 17, 2012
    Messages
    1,552
    Reaction score
    2,604
    • Schine
    Camera orientation is still a bit buggy in that version. For the next version however, that is already fixed.

    When two lights schine on a surface, they are afaik added together ( http://en.wikipedia.org/wiki/File:RGB_illumination.jpg )
    I'm going to try, to make the lighting more smooth. I already normalized the function for gathering (from light sources), next I'm going to normalize the light per vertex.
    cheers,
    schema
     
    Joined
    May 27, 2012
    Messages
    19
    Reaction score
    0
    That's true. I don't know, but, there is something unrealistic about the lighting. The equation that I use for my game is:


    dx = abs(x-lightx)
    dy = abs(y-lighty)
    d=math.sqrt(dx*dx+dy*dy)
    if d
     
    Joined
    May 27, 2012
    Messages
    19
    Reaction score
    0
    The code messed up:

    dx = abs(x-lightx)

    dy = abs(y-lighty)

    d=math.sqrt(dx*dx+dy*dy)

    if d
     

    schema

    Cat God
    Joined
    Feb 17, 2012
    Messages
    1,552
    Reaction score
    2,604
    • Schine
    Looks right.
    The problem is, that I do not calculate lighting that that way. I'm using ambient occlusion to calculate 'lighting' blocks. This way, light will be blocked by obstacles. It't kind of an opposite approach to the normal lighting.

    This is a pretty good article about it:
    http://codeflow.org/entries/2010/dec/09/minecraft-like-rendering-experiments-in-opengl-4/

    My method differs a bit from that version though to save memory and processing.