56 lines
874 B
Plaintext
56 lines
874 B
Plaintext
|
|
/**
|
||
|
|
* Kepler - Core
|
||
|
|
* Copyright (c) 2010 kaj dijkstra STUDIOS
|
||
|
|
* All rights reserved.
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Author: Kaj Dijksta
|
||
|
|
*/
|
||
|
|
#version 300 es
|
||
|
|
|
||
|
|
precision highp float;
|
||
|
|
|
||
|
|
in vec3 position;
|
||
|
|
in vec2 uv;
|
||
|
|
|
||
|
|
out vec2 v_textureCoord;
|
||
|
|
|
||
|
|
uniform mat4 viewProjection;
|
||
|
|
|
||
|
|
void main(void) {
|
||
|
|
|
||
|
|
v_textureCoord = uv;
|
||
|
|
gl_Position = viewProjection * vec4(position, 1.0);
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
// #keplerEngine - Split
|
||
|
|
|
||
|
|
#version 300 es
|
||
|
|
|
||
|
|
precision highp float;
|
||
|
|
|
||
|
|
uniform sampler2D image;
|
||
|
|
uniform sampler2D entityIDSampler;
|
||
|
|
uniform float selectedEntityID;
|
||
|
|
|
||
|
|
in vec2 v_textureCoord;
|
||
|
|
|
||
|
|
out vec4 fragmentColor;
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
|
||
|
|
float entityID = texture(entityIDSampler, v_textureCoord).w;
|
||
|
|
|
||
|
|
if(entityID == selectedEntityID)
|
||
|
|
fragmentColor = vec4(1.0);
|
||
|
|
else
|
||
|
|
fragmentColor = vec4(0.0);
|
||
|
|
|
||
|
|
//fragmentColor = texture(entityIDSampler, v_textureCoord);
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|