
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
glsl-parallax-occlusion-mapping
Advanced tools
glslify module implementing parallax occlusion mapping.
glslify module implementing parallax occlusion mapping.
glslify is required for importing.
yarn add glsl-parallax-occlusion-mapping
npm i glsl-parallax-occlusion-mapping --save
When requiring, you must specify the number of layers
to use.
#pragma glslify: pom = require('glsl-parallax-occlusion-mapping', layers=8)
vec2 pom( sampler2D depthMap, vec2 uv, vec2 displacement, float pivot )
The function accepts 4 arguments:
depthMap
is your depth/displacement map. Only the red channel is used.uv
are your regular texture coordinates for depthMap
.displacement
is the direction in which to shift the texture. Usually this is the xy
component of your view direction multiplied by a depth scalar.pivot
(optional) describes the elevation from which to pivot the displacement (where 0.0 is the highest and 1.0 is the lowest elevation). Defaults to 0.0.It returns the new texture coordinates.
#pragma glslify: pom = require('glsl-parallax-occlusion-mapping', layers=8)
uniform sampler2D tDiffuse;
uniform sampler2D tDepth;
varying vec2 vUv;
void main() {
vec2 newUv = pom( tDepth, vUv, viewDirection.xy * .1 );
gl_FragColor = texture2D( tDiffuse, newUv );
}
This implementation is based on this great article.
FAQs
glslify module implementing parallax occlusion mapping.
The npm package glsl-parallax-occlusion-mapping receives a total of 6 weekly downloads. As such, glsl-parallax-occlusion-mapping popularity was classified as not popular.
We found that glsl-parallax-occlusion-mapping 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.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.