@openhps/core
Version:
Open Hybrid Positioning System - Core component
43 lines (25 loc) • 770 B
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = exports.default = /* glsl */`
vWorldPosition = worldPosition.xyz;
vec3 cameraToVertex;
if ( isOrthographic ) {
cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
} else {
cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
}
vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
vReflect = reflect( cameraToVertex, worldNormal );
vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
`;