glsl-specular-beckmann

WebJar for glsl-specular-beckmann

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

glsl-specular-beckmann
Last Version

Last Version

1.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

glsl-specular-beckmann
WebJar for glsl-specular-beckmann
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/glslify/glsl-specular-beckmann

Download glsl-specular-beckmann

How to add to project

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

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-specular-beckmann

Computes the specular power from the Beckmann distribution

Example

#pragma glslify: beckmann = require(glsl-specular-beckmann)

uniform vec3 eyePosition;
uniform vec3 lightPosition;

uniform float roughness;

varying vec3 surfacePosition;
varying vec3 surfaceNormal;

void main() {
  vec3 eyeDirection = normalize(eyePosition - surfacePosition);
  vec3 lightDirection = normalize(lightPosition - surfacePosition);
  vec3 normal = normalize(surfaceNormal);

  float power = beckmann(lightDirection, viewDirection, normal, roughness);

  gl_FragColor = vec4(power,power,power,1.0);
}

Usage

Install with npm:

npm install glsl-specular-beckmann

Then use with glslify.

API

#pragma glslify: beckmann = require(glsl-specular-beckmann)
float beckmann(vec3 lightDir, vec3 eyeDir, vec3 normal, float shininess)

Computes the specular power in the Beckmann model

  • lightDir is a unit length vec3 pointing from the surface point toward the light
  • eyeDir is a unit length vec3 pointing from the surface point toward the camera
  • normal is the surface normal at the sample point
  • roughness is a parameter between 0 and 1 measuring the surface roughness. Small values are shinier, larger values are rougher.

Returns A float representing the specular power

License

(c) 2014 Mikola Lysenko. MIT License

org.webjars.npm

Versions

Version
1.1.2