Closed acs closed 4 years ago
Samples of texture packs in Minecraft: https://www.pcgamesn.com/minecraft/15-best-minecraft-texture-packs Samples of shaders in MC: https://www.pcgamesn.com/minecraft/minecraft-shaders-best-graphics-mods
The guide to read on howto create texture packs: https://minecraft.gamepedia.com/Tutorials/Creating_a_resource_pack
Resource packs includes also animations. Here is a tutorial about it: https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/resource-packs/resource-pack-discussion/1256350-animation-in-resource-packs-a-minecraft-1-6
And in the official guide, you have info about animations also: https://minecraft.gamepedia.com/Resource_Pack#Animation
Howto create a shader in MV: https://thebitcave.gitbook.io/magicavoxel-resources/tutorials/writing-your-first-shader
How MV produces textures when exporting to polys:
Howto use textures in MV: https://magicavoxel.fandom.com/wiki/Importing_an_image_as_a_texture
What's the difference between material and texture?
Textures repository: https://www.texturex.com/
https://twitter.com/voxelers/status/1281464649037357058
Next step is to start trying shaders in MV. It is pretty easy!
But, what about shaders in Minecraft? Are they supported?
texture packs don't seem to include shaders: https://minecraft.gamepedia.com/Tutorials/Creating_a_resource_pack
So probably we need mods to add shaders.
https://www.planetminecraft.com/blog/textureresource-pack-creation---an-indepth-tutorial/ «Although using renders or shaders for the images to let the pack look better, it is recommended to use also default Minecraft (thus unmodded) screenshots as images as not everyone uses these modifications.»
It seems that you can download shaders and modify the GLSL included: https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/mods-discussion/2465939-how-to-make-a-glsl-shader-pack
So probably, at some point someone shows howto load GLSL code in Minecraft shaders, and then it is just a matter of implementing in GLSL the shaders logic you want.
GLSL Tutorial: http://www.lighthouse3d.com/tutorials/glsl-tutorial/
Howto write shaders in Minecraft: https://www.reddit.com/r/Minecraft/comments/7hwaxk/where_can_i_get_started_coding_shaders_in/dquf582/
It seems that using https://optifine.net/home and writing GLSL shaders is the way to go.
There are shaders in MC for the Spectator Mode: https://minecraft.gamepedia.com/Shaders
And inside the minecraft jar you can find:
[1.16.1]$ jar tvf 1.16.1.jar | grep shader
701 Wed Jun 24 10:31:12 CEST 2020 assets/minecraft/shaders/program/notch.fsh
1217 Wed Jun 24 10:31:12 CEST 2020 assets/minecraft/shaders/program/spider.json
640 Wed Jun 24 10:31:12 CEST 2020 assets/minecraft/shaders/program/blit.json
614 Wed Jun 24 10:31:12 CEST 2020 assets/minecraft/shaders/program/outline.json
...
and you can see it is using GLSL shaders:
[mc]$ cat assets/minecraft/shaders/program/antialias.fsh
#version 110
uniform sampler2D DiffuseSampler;
varying vec2 texCoord;
varying vec2 oneTexel;
void main(){
vec4 c = texture2D (DiffuseSampler, texCoord);
vec4 u1 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, -oneTexel.y ));
...
vec4 color = mix (v5, v6, 0.5);
gl_FragColor = vec4(color.rgb, 1.0);
}
The renderer in MagicaVoxel it is based on ray tracing: interactive path tracing renderer. https://medium.com/@junyingw/future-of-gaming-rasterization-vs-ray-tracing-vs-path-tracing-32b334510f1f
The idea is simple: in order to increase the resolution of the surface in the polys, a 2D texture is mapped over them. The key is to define which (u,v) of the texture use in each coordinate (x, y, z) of the poly. The pixels in a texture are called texels, and to distinct the coordinates with the polys (x, y) are called (u, v) (for example Blender does that). OpenGL uses (s,t). The values for values for a texel coordinate goes from 0 to 1 (they are normalized).
m(x,y,z)->c(u,v)->(r,g,b,a)
Let's focus in creating a texturepack for Minecraft:
I have a first experience creating a skin for my player, that it is creating a texture for my player.
https://minecraft.gamepedia.com/Tutorials/Creating_a_resource_pack Resource packs can modify textures, models, animations, music, sounds, user interfaces, and languages.
Ok, creeper edition completed:
It is a bit tricky to understand the texture 2D map: the idea is to imaging you are wrapping the cubes.
The creeper has:
Changing textures in MC is interesting because the idea is the same than in other 3D tools. Let's do something similar in Blender.
I am going to stop the texture research for a while.
In Ray Tracing textures are also used: http://bentonian.com/Lectures/AdvGraph1314/3.%20Ray%20tracing%20-%20color%20and%20texture.pdf
Ok, #133 and #134 will be where the research will continue.
And also with #135 and #136 for Blender.
Ok, time to close this generic issue now that the more create ones have been created.
And example with MagicaVoxel:
https://github.com/lachlanmcdonald/magicavoxel-shaders/wiki