Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSL150/MetaballFP.glsl @ 12083

Last change on this file since 12083 was 12083, checked in by wiesep, 6 years ago

Reorganised shader programs

File size: 788 bytes
Line 
1#version 150
2
3// Ogre port of Nvidia's IsoSurf.cg file
4// Modified code follows. See http://developer.download.nvidia.com/SDK/10/opengl/samples.html for original
5//
6// Cg port of Yury Uralsky's metaball FX shader
7//
8// Authors: Simon Green and Yury Urlasky
9// Email: sdkfeedback@nvidia.com
10//
11// Copyright (c) NVIDIA Corporation. All rights reserved.
12////////////////////////////////////////////////////////////////////////////////////////////////////
13
14out vec4 fragColour;
15in vec3 oNormal;
16
17// Pixel shader
18void main()
19{
20        // Sanitize input
21        vec3 N = normalize(oNormal);
22        vec3 L = vec3(0, 0, 1);
23    float nDotL = dot(N, L);
24
25    vec3 materials[2] = vec3[](vec3(1, 1, 1), vec3(0, 0, 0.5));
26
27        fragColour = vec4(abs(nDotL) * materials[int(nDotL < 0.0)], 0.1);
28}
Note: See TracBrowser for help on using the repository browser.