mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-08 11:44:21 -04:00
Finish the log/log-top texturing, and add stone and soil textures.
This commit is contained in:
parent
6ef8c3c853
commit
48cfbc5c20
@ -1,12 +0,0 @@
|
||||
{
|
||||
"colors": [
|
||||
{"diffuse" : 0xeac174},
|
||||
{"diffuse" : 0xe4b466},
|
||||
{"diffuse" : 0xdea958},
|
||||
{"diffuse" : 0xdaa34d},
|
||||
{"diffuse" : 0xcc994a},
|
||||
{"diffuse" : 0xbf8d3f},
|
||||
{"diffuse" : 0xb98a41},
|
||||
{"diffuse" : 0xaf7d31}
|
||||
],
|
||||
}
|
28
assets/cubyz/block_materials/oak_wood1.json
Normal file
28
assets/cubyz/block_materials/oak_wood1.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"colors": [
|
||||
{"diffuse" : 0xeac174},
|
||||
{"diffuse" : 0xe4b466},
|
||||
{"diffuse" : 0xdea958},
|
||||
{"diffuse" : 0xdaa34d},
|
||||
{"diffuse" : 0xcc994a},
|
||||
{"diffuse" : 0xbf8d3f},
|
||||
{"diffuse" : 0xb98a41},
|
||||
{"diffuse" : 0xaf7d31}
|
||||
],
|
||||
|
||||
|
||||
"simplex1Wavelength": [8.0, 8.0, 8.0],
|
||||
"simplex1Weight": 0.0,
|
||||
|
||||
"simplex2Wavelength": [4.0, 16.0, 4.0],
|
||||
"simplex2DomainWarp": [0.05, 0.05, 0.05],
|
||||
"simplex2Weight": 1.0,
|
||||
|
||||
"simplex3Wavelength": [2.0, 8.0, 2.0],
|
||||
"simplex3DomainWarp": [0.1, 0.1, 0.1],
|
||||
"simplex3Weight": 0.5,
|
||||
|
||||
"brightnessOffset": 0.0,
|
||||
|
||||
"randomness": 0.1,
|
||||
}
|
28
assets/cubyz/block_materials/oak_wood2.json
Normal file
28
assets/cubyz/block_materials/oak_wood2.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"colors": [
|
||||
{"diffuse" : 0xeac174},
|
||||
{"diffuse" : 0xe4b466},
|
||||
{"diffuse" : 0xdea958},
|
||||
{"diffuse" : 0xdaa34d},
|
||||
{"diffuse" : 0xcc994a},
|
||||
{"diffuse" : 0xbf8d3f},
|
||||
{"diffuse" : 0xb98a41},
|
||||
{"diffuse" : 0xaf7d31}
|
||||
],
|
||||
|
||||
|
||||
"simplex1Wavelength": [8.0, 8.0, 8.0],
|
||||
"simplex1Weight": 0.0,
|
||||
|
||||
"simplex2Wavelength": [4.0, 16.0, 4.0],
|
||||
"simplex2DomainWarp": [0.05, 0.05, 0.05],
|
||||
"simplex2Weight": 1.0,
|
||||
|
||||
"simplex3Wavelength": [2.0, 8.0, 2.0],
|
||||
"simplex3DomainWarp": [0.1, 0.1, 0.1],
|
||||
"simplex3Weight": 0.5,
|
||||
|
||||
"brightnessOffset": 1.5,
|
||||
|
||||
"randomness": 0.1,
|
||||
}
|
24
assets/cubyz/block_materials/soil.json
Normal file
24
assets/cubyz/block_materials/soil.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"colors": [
|
||||
{"diffuse" : 0x3c2e20},
|
||||
{"diffuse" : 0x3a2c1f},
|
||||
{"diffuse" : 0x382a1e},
|
||||
{"diffuse" : 0x35271c},
|
||||
{"diffuse" : 0x34251c}
|
||||
],
|
||||
|
||||
|
||||
|
||||
"simplex1Wavelength": [4.0, 4.0, 4.0],
|
||||
"simplex1Weight": 2.0,
|
||||
|
||||
"simplex2Wavelength": [2.0, 2.0, 2.0],
|
||||
"simplex2Weight": 1.0,
|
||||
|
||||
"simplex3Wavelength": [1.0, 1.0, 1.0],
|
||||
"simplex3Weight": 0.5,
|
||||
|
||||
"brightnessOffset": -0.5,
|
||||
|
||||
"randomness": 0.5,
|
||||
}
|
26
assets/cubyz/block_materials/stone.json
Normal file
26
assets/cubyz/block_materials/stone.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"colors": [
|
||||
{"diffuse" : 0x6b6964},
|
||||
{"diffuse" : 0x62605a},
|
||||
{"diffuse" : 0x595854},
|
||||
{"diffuse" : 0x575551},
|
||||
{"diffuse" : 0x54504d},
|
||||
{"diffuse" : 0x4f4b48}
|
||||
],
|
||||
|
||||
|
||||
|
||||
"simplex1Wavelength": [20000.0, 4000.0, 20000.0],
|
||||
"simplex1Weight": 0.0,
|
||||
|
||||
"simplex2Wavelength": [0.0, 0.0, 0.0],
|
||||
"simplex2DomainWarp": [250, 250, 250],
|
||||
"simplex2Weight": 2.5,
|
||||
|
||||
"simplex3Wavelength": [3.0, 8.0, 6.0],
|
||||
"simplex3Weight": 1.0,
|
||||
|
||||
"brightnessOffset": 0.0,
|
||||
|
||||
"randomness": 0.0,
|
||||
}
|
@ -7,10 +7,8 @@
|
||||
"rotation" : "cubyz:log",
|
||||
"model" : "log",
|
||||
"palette" : [
|
||||
"cubyz:oak_wood",
|
||||
"cubyz:oak_wood1",
|
||||
"cubyz:oak_wood2",
|
||||
"cubyz:oak_bark"
|
||||
],
|
||||
"texture" : "cubyz:oak_log_side",
|
||||
"//texture_top" : "cubyz:oak_log_rings_top",
|
||||
"//texture_bottom" : "cubyz:oak_log_rings_bottom"
|
||||
}
|
||||
|
@ -5,8 +5,10 @@
|
||||
"auto"
|
||||
],
|
||||
"rotation" : "cubyz:log",
|
||||
"model" : "cube",
|
||||
"texture" : "cubyz:oak_log_side",
|
||||
"texture_top" : "cubyz:oak_log_top",
|
||||
"texture_bottom" : "cubyz:oak_log_rings_bottom",
|
||||
"model" : "logTop",
|
||||
"palette" : [
|
||||
"cubyz:oak_wood1",
|
||||
"cubyz:oak_wood2",
|
||||
"cubyz:oak_bark"
|
||||
],
|
||||
}
|
||||
|
@ -5,5 +5,7 @@
|
||||
"auto"
|
||||
],
|
||||
"model" : "cube",
|
||||
"texture" : "cubyz:soil"
|
||||
"palette" : [
|
||||
"cubyz:soil"
|
||||
]
|
||||
}
|
||||
|
@ -6,5 +6,7 @@
|
||||
"cubyz:cobblestone"
|
||||
],
|
||||
"model" : "cube",
|
||||
"texture" : "cubyz:stone"
|
||||
"palette" : [
|
||||
"cubyz:stone"
|
||||
]
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ pub const Window = struct {
|
||||
if(c.gladLoadGL() == 0) {
|
||||
return error.GLADFailed;
|
||||
}
|
||||
c.glfwSwapInterval(1);
|
||||
c.glfwSwapInterval(0);
|
||||
|
||||
if(@import("builtin").mode == .Debug) {
|
||||
c.glEnable(c.GL_DEBUG_OUTPUT);
|
||||
|
@ -120,8 +120,35 @@ fn log(_x: u16, _y: u16, _z: u16) ?u4 {
|
||||
var y = @intToFloat(f32, _y) - 7.5;
|
||||
var z = @intToFloat(f32, _z) - 7.5;
|
||||
_ = y;
|
||||
if(x*x + z*z < 5.5*5.5) return 0;
|
||||
if(x*x + z*z < 6.5*6.5) return 1;
|
||||
const radius = x*x + z*z;
|
||||
if(radius < 0.9*0.9) return 0;
|
||||
if(radius < 1.9*1.9) return 1;
|
||||
if(radius < 2.9*2.9) return 0;
|
||||
if(radius < 3.9*3.9) return 1;
|
||||
if(radius < 4.9*4.9) return 0;
|
||||
if(radius < 5.9*5.9) return 1;
|
||||
if(radius < 6.9*6.9) return 0;
|
||||
if(radius < 8.0*8.0) return 2;
|
||||
return null;
|
||||
}
|
||||
|
||||
fn logTop(_x: u16, _y: u16, _z: u16) ?u4 {
|
||||
var x = @intToFloat(f32, _x) - 7.5;
|
||||
var y = @intToFloat(f32, _y) - 7.5;
|
||||
var z = @intToFloat(f32, _z) - 7.5;
|
||||
const radius = if(y >= 0) (
|
||||
x*x + y*y + z*z
|
||||
) else (
|
||||
x*x + z*z
|
||||
);
|
||||
if(radius < 0.9*0.9) return 0;
|
||||
if(radius < 1.9*1.9) return 1;
|
||||
if(radius < 2.9*2.9) return 0;
|
||||
if(radius < 3.9*3.9) return 1;
|
||||
if(radius < 4.9*4.9) return 0;
|
||||
if(radius < 5.9*5.9) return 1;
|
||||
if(radius < 6.9*6.9) return 0;
|
||||
if(radius < 8.0*8.0) return 2;
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -166,6 +193,9 @@ pub fn init() !void {
|
||||
try nameToIndex.put("log", @intCast(u16, voxelModels.items.len));
|
||||
(try voxelModels.addOne()).init(log);
|
||||
|
||||
try nameToIndex.put("logTop", @intCast(u16, voxelModels.items.len));
|
||||
(try voxelModels.addOne()).init(logTop);
|
||||
|
||||
try nameToIndex.put("fence", @intCast(u16, voxelModels.items.len));
|
||||
(try voxelModels.addOne()).init(fence);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user