1#version 100 2precision highp float; 3precision highp int; 4precision lowp sampler2D; 5precision lowp samplerCube; 6/* 7----------------------------------------------------------------------------- 8This source file is part of OGRE 9(Object-oriented Graphics Rendering Engine) 10For the latest info, see http://www.ogre3d.org 11 12Copyright (c) 2000-2013 Torus Knot Software Ltd 13Permission is hereby granted, free of charge, to any person obtaining a copy 14of this software and associated documentation files (the "Software"), to deal 15in the Software without restriction, including without limitation the rights 16to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17copies of the Software, and to permit persons to whom the Software is 18furnished to do so, subject to the following conditions: 19 20The above copyright notice and this permission notice shall be included in 21all copies or substantial portions of the Software. 22 23THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29THE SOFTWARE. 30----------------------------------------------------------------------------- 31*/ 32 33//----------------------------------------------------------------------------- 34// Program Name: FFPLib_Transform 35// Program Desc: Transform functions of the FFP. 36// Program Type: Vertex shader 37// Language: GLSL ES 38// Notes: Implements core functions for FFPTransform class. 39// based on transform engine. 40// See http://msdn.microsoft.com/en-us/library/bb206269.aspx 41//----------------------------------------------------------------------------- 42 43//----------------------------------------------------------------------------- 44void FFP_Transform(in mat4 m, 45 in vec4 v, 46 out vec4 vOut) 47{ 48 vOut = m * v; 49} 50 51//----------------------------------------------------------------------------- 52void FFP_Transform(in mat4 m, 53 in vec4 v, 54 out vec3 vOut) 55{ 56 vOut = (m * v).xyz; 57} 58 59//----------------------------------------------------------------------------- 60void FFP_Transform(in mat4 m, 61 in vec3 v, 62 out vec3 vOut) 63{ 64 vOut = mat3(m) * v; 65}