|
@@ -32,9 +32,9 @@ export class MaterialHelper {
|
|
|
* @param effect The effect to be bound
|
|
|
* @param scene The scene the eyes position is used from
|
|
|
*/
|
|
|
- public static BindEyePosition(effect: Effect, scene: Scene): void {
|
|
|
+ public static BindEyePosition(effect: Effect, scene: Scene, variableName = "vEyePosition"): void {
|
|
|
if (scene._forcedViewPosition) {
|
|
|
- effect.setVector3("vEyePosition", scene._forcedViewPosition);
|
|
|
+ effect.setVector3(variableName, scene._forcedViewPosition);
|
|
|
return;
|
|
|
}
|
|
|
var globalPosition = scene.activeCamera!.globalPosition;
|
|
@@ -42,7 +42,7 @@ export class MaterialHelper {
|
|
|
// Use WebVRFreecamera's device position as global position is not it's actual position in babylon space
|
|
|
globalPosition = (scene.activeCamera! as WebVRFreeCamera).devicePosition;
|
|
|
}
|
|
|
- effect.setVector3("vEyePosition", scene._mirroredCameraPosition ? scene._mirroredCameraPosition : globalPosition);
|
|
|
+ effect.setVector3(variableName, scene._mirroredCameraPosition ? scene._mirroredCameraPosition : globalPosition);
|
|
|
}
|
|
|
|
|
|
/**
|