Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/GLSL150/IsosurfFS.glsl @ 12412

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

Changed folder structure, deletet some unused files and cleaned up code

File size: 773 bytes
RevLine 
[12115]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
14in vec3 oNormal;
15
16out vec4 fragColour;
17
18// Pixel shader
19void main()
20{
21    // Sanitize input
22    vec3 N = normalize(oNormal);
23    vec3 L = vec3(0, 0, 1);
24    float nDotL = dot(N, L);
25
26    vec3 materials[2] = vec3[](vec3(1, 1, 1), vec3(0, 0, 0.5));
27
28    fragColour = vec4(abs(nDotL) * materials[int(nDotL < 0.0)], 0.1);
29}
Note: See TracBrowser for help on using the repository browser.