uniform sampler2D colorTexture;
uniform sampler2D bloomTexture;
uniform bool glowOnly;
varying vec2 v_textureCoordinates;
void main(void)
{
vec4 color = texture2D(colorTexture, v_textureCoordinates);
#ifdef CZM_SELECTED_FEATURE
if (czm_selected()) {
gl_FragColor = color;
return;
}
#endif
vec4 bloom = texture2D(bloomTexture, v_textureCoordinates);
gl_FragColor = glowOnly ? bloom : bloom + color;
}#define CZM_SELECTED_FEATURE uniform sampler2D czm_idTexture; uniform sampler2D czm_selectedIdTexture; uniform float czm_selectedIdTextureStep; varying vec2 v_textureCoordinates; bool czm_selected(vec2 offset) { bool selected = false; vec4 id = texture2D(czm_idTexture, v_textureCoordinates + offset); for (int i = 0; i < 1; ++i) { vec4 selectedId = texture2D(czm_selectedIdTexture, vec2(float(i) * czm_selectedIdTextureStep, 0.5)); if (all(equal(id, selectedId))) { return true; } } return false; }
bool czm_selected() { return czm_selected(vec2(0.0)); }
uniform sampler2D colorTexture;uniform sampler2D bloomTexture;uniform bool glowOnly;
void main(void){ vec4 color = texture2D(colorTexture, v_textureCoordinates); #ifdef CZM_SELECTED_FEATURE if (czm_selected()) { gl_FragColor = color; return; }#endif
vec4 bloom = texture2D(bloomTexture, v_textureCoordinates); gl_FragColor = glowOnly ? bloom : bloom + color;}