-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refacto(points): material as superset of three PointsMaterial
BREAKING CHANGE: * Remove overlayColor property (replaced by the standard diffuse property)
- Loading branch information
1 parent
c93a2cd
commit 63af9e2
Showing
4 changed files
with
278 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,43 @@ | ||
#include <itowns/precision_qualifier> | ||
#define USE_COLOR_ALPHA | ||
|
||
#include <color_pars_fragment> | ||
#include <map_particle_pars_fragment> | ||
#include <alphatest_pars_fragment> | ||
#include <alphahash_pars_fragment> | ||
#include <fog_pars_fragment> | ||
#include <logdepthbuf_pars_fragment> | ||
#include <clipping_planes_pars_fragment> | ||
|
||
uniform vec3 diffuse; | ||
uniform float opacity; | ||
|
||
varying vec4 vColor; | ||
uniform bool picking; | ||
uniform int shape; | ||
|
||
void main() { | ||
#include <logdepthbuf_fragment> | ||
//square shape does not require any change. | ||
|
||
// Early discard (clipping planes and shape) | ||
#include <clipping_planes_pars_fragment> | ||
if (shape == PNTS_SHAPE_CIRCLE) { | ||
//circular rendering in glsl | ||
if ((length(gl_PointCoord - 0.5) > 0.5) || (vColor.a == 0.0)) { | ||
discard; | ||
} | ||
} | ||
|
||
gl_FragColor = vColor; | ||
#include <logdepthbuf_fragment> | ||
|
||
vec4 diffuseColor = vec4(diffuse, opacity); | ||
#include <map_particle_fragment> | ||
#include <color_fragment> | ||
|
||
#include <alphatest_fragment> | ||
#include <alphahash_fragment> | ||
|
||
vec3 outgoingLight = diffuseColor.rgb; | ||
#include <opaque_fragment> // gl_FragColor | ||
#include <tonemapping_fragment> | ||
#include <fog_fragment> | ||
#include <premultiplied_alpha_fragment> | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.