mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 16:42:23 +02:00
Instead of calling glutSolidSphere, just call Application::getInstance()->getGeometryCache()->renderSphere(...) - replaced all the instances of "glutSolidSphere" - Changed the atmosphere shaders so instead of drawing a sphere of the size of the atmosphere, we draw a unit sphere, the vertices get scaled at the right radius in th vertex shader using fOuterRadius
43 lines
1.7 KiB
GLSL
43 lines
1.7 KiB
GLSL
#version 120
|
|
|
|
//
|
|
// For licensing information, see http://http.developer.nvidia.com/GPUGems/gpugems_app01.html:
|
|
//
|
|
// NVIDIA Statement on the Software
|
|
//
|
|
// The source code provided is freely distributable, so long as the NVIDIA header remains unaltered and user modifications are
|
|
// detailed.
|
|
//
|
|
// No Warranty
|
|
//
|
|
// THE SOFTWARE AND ANY OTHER MATERIALS PROVIDED BY NVIDIA ON THE ENCLOSED CD-ROM ARE PROVIDED "AS IS." NVIDIA DISCLAIMS ALL
|
|
// WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY,
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
//
|
|
// Limitation of Liability
|
|
//
|
|
// NVIDIA SHALL NOT BE LIABLE TO ANY USER, DEVELOPER, DEVELOPER'S CUSTOMERS, OR ANY OTHER PERSON OR ENTITY CLAIMING THROUGH OR
|
|
// UNDER DEVELOPER FOR ANY LOSS OF PROFITS, INCOME, SAVINGS, OR ANY OTHER CONSEQUENTIAL, INCIDENTAL, SPECIAL, PUNITIVE, DIRECT
|
|
// OR INDIRECT DAMAGES (WHETHER IN AN ACTION IN CONTRACT, TORT OR BASED ON A WARRANTY), EVEN IF NVIDIA HAS BEEN ADVISED OF THE
|
|
// POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
|
// LIMITED REMEDY. IN NO EVENT SHALL NVIDIA'S AGGREGATE LIABILITY TO DEVELOPER OR ANY OTHER PERSON OR ENTITY CLAIMING THROUGH
|
|
// OR UNDER DEVELOPER EXCEED THE AMOUNT OF MONEY ACTUALLY PAID BY DEVELOPER TO NVIDIA FOR THE SOFTWARE OR ANY OTHER MATERIALS.
|
|
//
|
|
|
|
//
|
|
// Atmospheric scattering vertex shader
|
|
//
|
|
// Author: Sean O'Neil
|
|
//
|
|
// Copyright (c) 2004 Sean O'Neil
|
|
//
|
|
|
|
uniform float fOuterRadius; // The outer (atmosphere) radius
|
|
|
|
varying vec3 position;
|
|
|
|
void main(void)
|
|
{
|
|
position = gl_Vertex.xyz * fOuterRadius;
|
|
gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1.0);
|
|
}
|