Tag Info

Hot answers tagged


No, glsl can't have parameters in the main function (as well as return values). The doc says: Just like in C/C++, execution of a shader begins with the function main. This function takes no parameters and returns no values.


What you need is to retroproject the point on your map, from the inverse Mercator into 3d space, then place the sun as a directional light (not point like your image shows), and adjust the point for earth tilting (according to earth-sun rotation plane), then you can evaluate the light. It will automatically give you the weird valley shape that we see in ...


I believe that OpenGL's standard clipping volume is [-1, 1] x [-1, 1] x [-1, 1]. You want to clip at [-1, 1] x [-1, 1] x [0, 1]. You can achieve this by transforming the z-coordinate after all transformations have been applied to the vertex position (model, view and projection transforms). In other words, you want to operate on the screen coordinates of the ...

Only top voted, non community-wiki answers of a minimum length are eligible