JME is kind of an evolutionary dead end, so we're going to move all the JME
code into the Bang project directly so as to confine the dependencies on JME libraries to the only thing that will ever need them. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@1035 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 192 KiB |
@@ -1,56 +0,0 @@
|
||||
//
|
||||
// $Id: ImageCache.java 158 2007-02-24 00:38:17Z mdb $
|
||||
//
|
||||
// Nenya library - tools for developing networked games
|
||||
// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved
|
||||
// http://www.threerings.net/code/nenya/
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
/** The diffuse texture map. */
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
/** The emissive texture map. */
|
||||
#ifdef EMISSIVE_MAPPED
|
||||
uniform sampler2D emissiveMap;
|
||||
#endif
|
||||
|
||||
/** The amount of fog. */
|
||||
#ifdef FOG
|
||||
varying float fogAlpha;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Fragment shader for skinned meshes.
|
||||
*/
|
||||
void main ()
|
||||
{
|
||||
// start with the diffuse color
|
||||
vec4 fragColor = texture2D(diffuseMap, gl_TexCoord[0].st);
|
||||
|
||||
// modulate by the light color
|
||||
#ifdef EMISSIVE_MAPPED
|
||||
fragColor *= (gl_Color + vec4(texture2D(emissiveMap, gl_TexCoord[0].st).rgb, 0.0));
|
||||
#else
|
||||
fragColor *= gl_Color;
|
||||
#endif
|
||||
|
||||
// blend between the computed color and the fog color
|
||||
#ifdef FOG
|
||||
gl_FragColor = mix(gl_Fog.color, fragColor, fogAlpha);
|
||||
#else
|
||||
gl_FragColor = fragColor;
|
||||
#endif
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
//
|
||||
// $Id: ImageCache.java 158 2007-02-24 00:38:17Z mdb $
|
||||
//
|
||||
// Nenya library - tools for developing networked games
|
||||
// Copyright (C) 2002-2010 Three Rings Design, Inc., All Rights Reserved
|
||||
// http://www.threerings.net/code/nenya/
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published
|
||||
// by the Free Software Foundation; either version 2.1 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
/** The bone transforms. */
|
||||
uniform mat4 boneTransforms[MAX_BONE_COUNT];
|
||||
|
||||
/** The bone indices. */
|
||||
attribute vec4 boneIndices;
|
||||
|
||||
/** The bone weights. */
|
||||
attribute vec4 boneWeights;
|
||||
|
||||
/** The amount of fog. */
|
||||
#ifdef FOG
|
||||
varying float fogAlpha;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Vertex shader for skinned meshes.
|
||||
*/
|
||||
void main ()
|
||||
{
|
||||
vec4 normal4 = vec4(gl_Normal, 0.0);
|
||||
|
||||
// add up the vertex as transformed by each bone and scaled by each weight
|
||||
vec4 modelVertex = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
vec4 modelNormal = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
for (int ii = 0; ii < 4; ii++) {
|
||||
mat4 boneTransform = boneTransforms[int(boneIndices[ii])];
|
||||
modelVertex += boneTransform * gl_Vertex * boneWeights[ii];
|
||||
modelNormal += boneTransform * normal4 * boneWeights[ii];
|
||||
}
|
||||
|
||||
// apply the standard transformation
|
||||
gl_Position = gl_ModelViewProjectionMatrix * modelVertex;
|
||||
|
||||
// transform the vertex and normal into eye space
|
||||
vec3 eyeVertex = vec3(gl_ModelViewMatrix * modelVertex);
|
||||
vec3 eyeNormal = normalize(vec3(gl_ModelViewMatrixInverseTranspose * modelNormal));
|
||||
|
||||
// set gl_FrontColor based on vertex, normal and light parameters
|
||||
SET_FRONT_COLOR
|
||||
|
||||
// set the varying texture coordinates
|
||||
SET_TEX_COORDS
|
||||
|
||||
// set the fog alpha based on the eye space vertex
|
||||
SET_FOG_ALPHA
|
||||
}
|
||||
Reference in New Issue
Block a user