Shaders integration - Vivecraft/VivecraftMod GitHub Wiki
Since version 1.2.4 of Vivecraft some macros and uniforms are provided to optifine/iris shaders
Macros
VIVECRAFT
#define VIVECRAFT
Is defined when the Vivecraft mod is loaded
Renderpasses
The following renderpasses are defined, to be used with the vivecraftRenderpass
uniform
#define VIVECRAFT_PASS_LEFT // renders the left eye perspective
#define VIVECRAFT_PASS_RIGHT // renders the right eye perspective
#define VIVECRAFT_PASS_CENTER // renders the first person slow mirror
#define VIVECRAFT_PASS_THIRD // renders the third person slow mirror
#define VIVECRAFT_PASS_GUI // draws the Minecraft gui/hud (not actually usable by shaders)
#define VIVECRAFT_PASS_SCOPER // renders the main hand spyglass perspective
#define VIVECRAFT_PASS_SCOPEL // renders the offhand spyglass perspective
#define VIVECRAFT_PASS_CAMERA // renders the screenshot camera perspective
#define VIVECRAFT_PASS_MIRROR // shows the mirror (not actually usable by shaders)
#define VIVECRAFT_PASS_VANILLA // renders the vanilla perspective, usually not used
Uniforms
Vivecraft provides these uniforms to shaders, most are only valid when VR is actively running.
They need to be manually declared to be used, Vivecraft just supplies the data for them.
vivecraftIsVR
uniform bool vivecraftIsVR;
If true, then VR is actively running
vivecraftRenderpass
uniform int vivecraftRenderpass;
Can be used to check the current renderpass, use the Renderpasses macro to check for a specific one
vivecraftRelativeMainHandPos
uniform vec3 vivecraftRelativeMainHandPos;
Contains the relative position of the players main hand to the camera.
vivecraftRelativeOffHandPos
uniform vec3 vivecraftRelativeOffHandPos;
Contains the relative position of the players offhand to the camera.
vivecraftRelativeMainHandRot
uniform mat4 vivecraftRelativeMainHandRot;
Contains the rotation of the players main hand, in world space.
Only the top mat3x3 is used, there is no offset in there
vivecraftRelativeOffHandRot
uniform mat4 vivecraftRelativeOffHandRot;
Contains the rotation of the players offhand, in world space.
Only the top mat3x3 is used, there is no offset in there