Skip to content

Commit

Permalink
fix: face found
Browse files Browse the repository at this point in the history
  • Loading branch information
LuXDAmore committed Nov 30, 2020
1 parent 25745a9 commit db6e3e1
Show file tree
Hide file tree
Showing 5 changed files with 308 additions and 143 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
// VSCode Frag
#pragma vscode_glsllint_stage : frag

// Const
const float PI = 3.1415926535897932384626433832795;

// Varying
varying vec3 vPos;
varying vec4 vPos;
varying vec2 vUv;

// Main
void main () {

gl_FragColor = vec4( gl_PointCoord, 1., 1. ) * vec4( vPos, 1. );
// Make point rounded
float dist = length( gl_PointCoord - vec2( 0.5 ) );
float alpha = 1. - smoothstep( 0.45, 0.5, dist );

// Bring back pixels
// gl_FragColor = vec4( gl_PointCoord, 1., alpha ) * vPos;
// gl_FragColor = vec4( vPos.xyz, alpha );
gl_FragColor = vec4( vUv, 1., alpha );

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
#pragma vscode_glsllint_stage : vert

// Varying
varying vec3 vPos;
varying vec4 vPos;
varying vec2 vUv;

// Main
void main () {

vPos = position.xyz;
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );

vec4 mvPosition = modelViewMatrix * vec4( position.xyz, 1.0 );
vUv = uv;
vPos = mvPosition;

gl_PointSize = 2. * ( 1. / - mvPosition.z );
gl_PointSize = 10. * ( 1. / - mvPosition.z );

gl_Position = projectionMatrix * mvPosition;

Expand Down
28 changes: 28 additions & 0 deletions example/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,34 @@ video {

}

button {

width: 100%;
max-width: 354px;
margin: 16px auto;
padding: 8px;
color: #f05;
font-weight: bold;
line-height: 1.36;
text-align: center;
background-color: #f3f0f1;
border: 0;
border-radius: 6px;
cursor: pointer;
opacity: .9;
transition: all .27s ease-in-out;
appearance: none;

}

button:hover,
button:active,
button:focus {

opacity: 1;

}

.opacity-50 {

opacity: .5;
Expand Down
Loading

0 comments on commit db6e3e1

Please sign in to comment.