Dax's Wiki
Explore
Main Page
All Pages
Community
Interactive Maps
Recent Blog Posts
Wiki Content
Recently Changed Pages
Texture Packs (Shaders)
Editing Shaders (Shaders)
Alternative Shaders (Shaders)
Hardware Compatibility (Shaders)
Bump Mapping (Shaders2)
Editing Shaders (Shaders2)
Hardware Compatibility (Shaders2)
Shaders
Shaders
Editing Shaders (Shaders)
Alternative Shaders (Shaders)
Mod Compatibility (Shaders)
Installation (Shaders)
Compiling (Shaders)
Texture Packs (Shaders)
Shaders2
Editing Shaders (Shaders2)
Mod Compatibility (Shaders2)
Installation (Shaders2)
Bump Mapping (Shaders2)
Texture Packs (Shaders2)
Modifications and Related Mods (Shaders2)
Compiling (Shaders2)
Community
Help
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
Dax's Wiki
31
pages
Explore
Main Page
All Pages
Community
Interactive Maps
Recent Blog Posts
Wiki Content
Recently Changed Pages
Texture Packs (Shaders)
Editing Shaders (Shaders)
Alternative Shaders (Shaders)
Hardware Compatibility (Shaders)
Bump Mapping (Shaders2)
Editing Shaders (Shaders2)
Hardware Compatibility (Shaders2)
Shaders
Shaders
Editing Shaders (Shaders)
Alternative Shaders (Shaders)
Mod Compatibility (Shaders)
Installation (Shaders)
Compiling (Shaders)
Texture Packs (Shaders)
Shaders2
Editing Shaders (Shaders2)
Mod Compatibility (Shaders2)
Installation (Shaders2)
Bump Mapping (Shaders2)
Texture Packs (Shaders2)
Modifications and Related Mods (Shaders2)
Compiling (Shaders2)
Community
Help
Editing
Editing Shaders (Shaders)
Back to page
Edit
Edit source
View history
Talk (0)
Edit Page
Editing Shaders (Shaders)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
The edit appears to have already been undone.
Anti-spam check. Do
not
fill this in!
== Shaders == The active shaders should be located in the contents/files/shaders folder. There are four shaders that can be used. The outputs of the base shaders are sent to the final shaders in the form of textures. == Structures == === lightSource === struct lightSource { int itemId; float magnitude; vec4 specular; }; == Attributes == === vec4 mc_Entity === ==== mc_Entity.x ==== The x component of mc_Entity is the entity id. Currently this is only set for blocks. In future updates it will be set for items and mobs. It will have a value of -1.0 for unknown entities. ==== mc_Entity.y ==== The y component of mc_Entity contains information regarding lighting. It is currently calculated as lightValue * 16 + brightness. In future updates other additions may be made to this (such as the sides exposed to the sky). In the shaders, lightValue can be obtained by ''mod(floor(mc_Entity.y / 16.0), 16.0)''. brightness can be obtained by ''mod(mc_Entity.y, 16.0)''. ==== mc_Entity.z ==== ''Reserved'' ==== mc_Entity.w ==== ''Reserved'' == Uniforms == There are several uniforms available to the shaders. === Global Uniforms === ==== '''float displayWidth''' ==== The width of the display. ==== '''float displayHeight''' ==== The height of the display. ==== '''float aspectRatio''' ==== The aspect ratio of the display (displayWidth / displayHeight). ==== '''float near''' ==== The near viewing plane. ==== '''float far''' ==== The far viewing plane. ==== '''int fogMode''' ==== The current fog mode. The possible values are as follows: const int GL_LINEAR = 9729; const int GL_EXP = 2048; ==== '''float sunVector''' ==== The position of the sun in eye coordinates. ==== '''float moonVector''' ==== The position of the moon in eye coordinates. ==== '''int worldTime''' ==== The world time of day (ranges from 0 to 23999). ==== '''lightSource heldLight''' ==== The properties of the item currently being held. === Base Uniforms === ==== '''sampler2D sampler0''' ==== The texture of the current element. ==== '''sampler2D sampler1''' ==== The normals and height-map for the current texture (loaded from XXXXX_nh.png). At the moment this is only accurate when renderType is equal to RENDER_TYPE_TERRAIN. '''int renderType''' Type of rendering: renderType is equal to 0 for items, entities, signs, water, ice etc., renderType is equal to 1 for blocks. === Final Uniforms === ==== '''Hacked''' ==== ==== '''sampler2D sampler1''' ==== The depth of the rendered scene, excluding the player's arm. ==== '''sampler2D sampler2''' ==== The depth of the player's arm. == Tips == === Anti-Aliasing === To avoid anti-aliasing on polygon edges, texture coordinates should be declared as ''centroid'' in the base vertex and fragment shaders. AA form is in FXAA 2x 4x & 8x. βFast Approximate Anti-Aliasing This AA method analyzes the pixel on the screen and ignores polygons and lines in a pre buffered frame..[[Category:Shaders]]
Summary:
Please note that all contributions to the Dax's Wiki are considered to be released under the CC-BY-SA
Cancel
Editing help
(opens in new window)
Follow on IG
TikTok
Join Fan Lab