glsl-out-of-range

WebJar for glsl-out-of-range

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

glsl-out-of-range
Last Version

Last Version

1.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

glsl-out-of-range
WebJar for glsl-out-of-range
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/plotly/glsl-out-of-range

Download glsl-out-of-range

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/glsl-out-of-range/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>glsl-out-of-range</artifactId>
    <version>1.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/glsl-out-of-range/
implementation 'org.webjars.npm:glsl-out-of-range:1.0.4'
// https://jarcasting.com/artifacts/org.webjars.npm/glsl-out-of-range/
implementation ("org.webjars.npm:glsl-out-of-range:1.0.4")
'org.webjars.npm:glsl-out-of-range:jar:1.0.4'
<dependency org="org.webjars.npm" name="glsl-out-of-range" rev="1.0.4">
  <artifact name="glsl-out-of-range" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='glsl-out-of-range', version='1.0.4')
)
libraryDependencies += "org.webjars.npm" % "glsl-out-of-range" % "1.0.4"
[org.webjars.npm/glsl-out-of-range "1.0.4"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

glsl-out-of-range

Tests if a point is outside ranges. It could be useful in vertex & fragment shaders to support reversed ranges (bounds) in 3D/2D scenes.

Function prototypes:

bool outOfRange(float a, float b, float p);

bool outOfRange(vec2 a, vec2 b, vec2 p);

bool outOfRange(vec3 a, vec3 b, vec3 p);

bool outOfRange(vec4 a, vec4 b, vec4 p);

Please note that in the case of vec4 input arguments, only 3 tests are made i.e. for xyz and not for w.

Example

#pragma glslify: outOfRange = require(glsl-out-of-range)

void main() {
  if (outOfRange(bounds[0], bounds[1], position)) discard;

  gl_FragColor = vec4(1.0, 0.5, 0.25, 1.0);
}

Usage

Install with npm:

npm install glsl-out-of-range

Then use with glslify.

API

#pragma glslify: outOfRange = require(glsl-out-of-range)

Creators

Github Twitter
Alex C. Johnson @alexcjohnson
Étienne Tétreault-Pinard @etpinard @etpinard
Mojtaba Samimi @archmoj

Copyright and license

Code and documentation copyright 2018 Plotly, Inc.

Code released under the MIT license.

Docs released under the Creative Commons license.

org.webjars.npm

Plotly

Versions

Version
1.0.4
1.0.3