Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
glsl-specular-ward
Advanced tools
Computes the anisotropic specularity in the Ward model
#pragma glslify: wardSpec = require(glsl-specular-ward)
uniform vec3 eyePosition;
uniform vec3 lightPosition;
uniform float shinyPar, shinyPerp;
varying vec3 surfacePosition;
varying vec3 surfaceNormal;
varying vec3 fiberDirection;
void main() {
//Light and view geometry
vec3 eyeDirection = normalize(eyePosition - surfacePosition);
vec3 lightDirection = normalize(lightPosition - surfacePosition);
//Surface properties
vec3 normal = normalize(surfaceNormal);
vec3 fiberPar = normalize(fiberDirection);
vec3 fiberPerp = normalize(cross(surfaceNormal, fiberDirection));
//Compute specular power
float power = wardSpec(
lightDirection,
viewDirection,
normal,
fiberPar,
fiberPerp,
shinyPar,
shinyPerp);
gl_FragColor = vec4(power,power,power,1.0);
}
Install with npm:
npm install glsl-specular-phong
Then use with glslify.
#pragma glslify: ward = require(glsl-specular-ward)
float ward(vec3 lightDir, vec3 eyeDir, vec3 normal, vec3 fiberParallel, vec3 fiberPerpendicular, float shinyParallel, float shinyPerpendicular)
Computes the specular power in the Phong lighting model.
lightDir
is a unit length vec3
pointing from the surface point toward the lighteyeDir
is a unit length vec3
pointing from the surface point toward the cameranormal
is the unit length surface normal at the sample pointfiberParallel
is a unit length vector tangent to the surface aligned with the local fiber orientationfiberPerpendicular
is a unit length vector tangent to surface aligned with the local fiber orientationshinyParallel
is the roughness of the fibers in the parallel directionshinyPerpendicular
is the roughness of the fibers in perpendicular directionReturns A float
representing the specular power
(c) 2014 Mikola Lysenko. MIT License
FAQs
Ward anisotropic specular model
The npm package glsl-specular-ward receives a total of 0 weekly downloads. As such, glsl-specular-ward popularity was classified as not popular.
We found that glsl-specular-ward demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.