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-diffuse-oren-nayar
Advanced tools
The Oren-Nayar diffuse lighting model implemented in GLSL.
#pragma glslify: orenNayar = require(glsl-diffuse-orenNayar)
uniform vec3 lightPosition, eyePosition;
varying vec3 surfacePosition, surfaceNormal;
void main() {
//Light and view geometry
vec3 lightDirection = normalize(lightPosition - surfacePosition);
vec3 viewDirection = normalize(eyePosition - surfacePosition);
//Surface properties
vec3 normal = normalize(surfaceNormal);
//Compute diffuse light intensity
float power = orenNayar(
lightDirection,
viewDirection,
normal,
0.3,
0.7);
gl_FragColor = vec4(power,power,power,1.0);
}
Install with npm:
npm install glsl-diffuse-oren-nayar
Then use with glslify.
#pragma glslify: orenNayar = require(glsl-diffuse-oren-nayar)
float orenNayar(vec3 lightDir, vec3 viewDir, vec3 normal, float roughness, float albedo)
Computes the diffuse intensity in the Lambertian model
lightDir
is a unit length vec3
pointing from the surface point toward the lightviewDir
is a unit length vec3
pointing toward the cameranormal
is the unit length surface normal at the sample pointroughness
is a parameter between 0 and 1 measuring the surface roughness. 0 for smooth, 1 for mattealbedo
measures the intensity of the diffuse reflection. Values >0.96
do not conserve energyReturns A float
representing the diffuse light intensity
(c) 2014 Mikola Lysenko. MIT License
FAQs
Oren-Nayar diffuse lighting model
The npm package glsl-diffuse-oren-nayar receives a total of 16 weekly downloads. As such, glsl-diffuse-oren-nayar popularity was classified as not popular.
We found that glsl-diffuse-oren-nayar 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.