Skip to content

Commit 8ae7060

Browse files
committed
Bug fixes.
1 parent 9f20d65 commit 8ae7060

File tree

4 files changed

+30
-15
lines changed

4 files changed

+30
-15
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Eric's MagicaVoxel Shaders
22
Shaders for MagicaVoxel including Terrain Generator, Advanced Flood System etc.
33

4+
**IMPORTANT** The bugs related to the executing failure have been all fixed. Feel free to have a try if you came across the problems before.
5+
46
## Internationalization
5-
- <a href="./i18n/README-sc.md">简体中文</a> - translated by <a href="http://github.com/codingeric">CodingEric</a>, target version: `0.0.9.0`
7+
- <a href="./i18n/README-sc.md">简体中文</a> - translated by <a href="http://github.com/codingeric">CodingEric</a>, target version: `0.1.0.0`
68
- <a href="./i18n/README-fr.md">Français</a> - translated by <a href="http://moiscript.weebly.com/magicavoxel.html">Pilou</a> - Authorized reproduce, target version: `0.0.7.0`
79

810
## Project Info
9-
* Current version: `0.0.9.9`
11+
* Current version: `0.1.0.0`
1012
* State: `LTS`
1113
* Tested with `MagicaVoxel 0.99.3 for Windows`
1214
* Released under `MIT License`
@@ -26,6 +28,9 @@ Copy the .txt files from the `shader` directory in this project to the `shader`
2628
| 0.99.2 || |
2729
| 0.99.3 || |
2830

31+
## Contribution
32+
Feel free to make a PR as long as you've followed the contributing guidelines.
33+
2934
## Shaders and usages
3035
>**Note** <br> - The parameters with `<>` can be ignored. Mostly, they are set to 0 as default. <br> - The shaders are not designed for selected areas without specific explanation. <br> - The documentation of deprecated/unstable shaders can be found in their folders.
3136
### INDEX
@@ -68,7 +73,7 @@ Copy the .txt files from the `shader` directory in this project to the `shader`
6873
<img src="img/tg2_2.png" width="250px"><img src="img/tg2_1.png" width="250px">
6974
### CAVE
7075
<a href="#index">back to index</a>
71-
>1. The 3d noise generator.
76+
>1. This is the 3d noise generator.
7277
>2. The noise generation method is provided by ashima/webgl-noise: Copyright (C) 2011 Ashima Arts. All rights reserved.
7378
* File name: `cave.txt`
7479
* Command-line usage: `xs cave [seed] [noise-scale] [voxel-color] [void-voxel-color (-1 for not emptying the scene)] [vertical-shifting] [x-shifting] [y-shifting]`

i18n/README-fr.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@ Installez ces shaders en copiant les fichiers du répertoire shader de ce projet
1313
* <a href="#flow2">Flow2</a>
1414
* <a href="#project">Project</a>
1515
* <a href="#life-game">Life game</a>
16-
* <a href="#blanket">Blanket</a>
1716
* <a href="#cube-filling">Cube filling</a>
1817
* <a href="#flood">Flood</a>
19-
* <a href="#hyperflood">[Unstable] Hyperflood</a>
20-
* <a href="#darker">[Deprecated] Darker Darker</a>
2118
### TERRAIN GENERATOR
2219
<a href="#catalogue">Retour au catalogue</a>
2320
* Nom de fichier: `tergen.txt`

i18n/README-sc.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
为MagicaVoxel设计的Shader,包含地形生成器,增强的洪流系统等。
77

88
## 项目信息
9-
* 当前版本: `0.0.9.0`
9+
* 当前版本: `0.1.0.0`
1010
* 状态: `长期支持`
1111
* 使用 `MagicaVoxel 0.99.3 for Windows` 测试
1212
*`MIT License` 下发行
@@ -31,6 +31,7 @@
3131
### <p id="index">目录</p>
3232
* <a href="#terrain-generator">Terrain generator</a>
3333
* <a href="#terrain-generator-2">Terrain generator 2</a>
34+
* <a href="#cave">Cave</a>
3435
* <a href="#flow">Flow</a>
3536
* <a href="#flow2">Flow2</a>
3637
* <a href="#project">Project</a>
@@ -40,7 +41,7 @@
4041
### TERRAIN GENERATOR
4142
<a href="#index">回到目录</a>
4243
>1. 更旧的版本由于不支持一些古老的GLSL版本已经被舍弃,十分感谢bug提交者的贡献。
43-
>2. 噪波生成提供方为 ashima/webgl-noise: Copyright (C) 2011 Ashima Arts 保留所有权利
44+
>2. 噪波生成提供方为 ashima/webgl-noise: Copyright (C) 2011 Ashima Arts 保留所有权利
4445
* 文件名称: `tergen.txt`
4546
* 命令行用法: `xs tergen [seed] [altitude]
4647
[noise-scale] [voxel-color] <void-voxel-color> <vertical-shifting> <x-shifting> <y-shifting>`
@@ -55,7 +56,7 @@
5556
### TERRAIN GENERATOR 2
5657
<a href="#index">回到目录</a>
5758
>1. 在地形生成器2中,地形覆盖在已存在的体素上。
58-
>2. 噪波生成提供方为 ashima/webgl-noise: Copyright (C) 2011 Ashima Arts 保留所有权利
59+
>2. 噪波生成提供方为 ashima/webgl-noise: Copyright (C) 2011 Ashima Arts 保留所有权利
5960
* 文件名称: `tergen2.txt`
6061
* 命令行用法: `xs tergen2 [seed] [altitude]
6162
[noise-scale] [voxel-color] <void-voxel-color> <vertical-shifting> <x-shifting> <y-shifting>`
@@ -65,6 +66,18 @@
6566
* 图片预览:
6667

6768
<img src="../img/tg2_2.png" width="250px"><img src="../img/tg2_1.png" width="250px">
69+
### CAVE
70+
<a href="#index">回到目录</a>
71+
>1. 这是三维噪波生成器。
72+
>2. 噪波生成提供方为 ashima/webgl-noise: Copyright (C) 2011 Ashima Arts 保留所有权利。
73+
* 文件名称: `cave.txt`
74+
* 命令行用法: `xs cave [seed] [noise-scale] [voxel-color] <void-voxel-color (-1 for not emptying the scene)> <vertical-shifting> <x-shifting> <y-shifting>`
75+
* 命令行用法示例: `xs cave 19260817 75 1 -1 10 10 10`
76+
* 命令行用法最简示例: `xs cave 19260817 75 1 -1`
77+
>把 void-voxel-color 设置为 -1 将不会清空场景。
78+
* 图片预览:
79+
80+
<img width="250px" src="../img/cave.png">
6881
### FLOW
6982
<a href="#index">回到目录</a>
7083
> 该shader模拟自然界中的水流效果。

shader/cubefill.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ MIT License
1515

1616
float map(vec3 v){
1717
if(iArgs[6]!=0.){
18-
if(iArgs[0]==0&&((v.x>=iArgs[1]&&v.x<=iArgs[4]||v.x>=iArgs[4]&&v.x<=iArgs[1])&&(v.y>=iArgs[2]&&v.y<=iArgs[5]||v.y>=iArgs[5]&&v.y<=iArgs[2])&&(v.z>=iArgs[3]&&v.z<=iArgs[6]||v.z>=iArgs[6]&&v.z<=iArgs[3]))){
18+
if(iArgs[0]==0.&&((v.x>=iArgs[1]&&v.x<=iArgs[4]||v.x>=iArgs[4]&&v.x<=iArgs[1])&&(v.y>=iArgs[2]&&v.y<=iArgs[5]||v.y>=iArgs[5]&&v.y<=iArgs[2])&&(v.z>=iArgs[3]&&v.z<=iArgs[6]||v.z>=iArgs[6]&&v.z<=iArgs[3]))){
1919
return iArgs[7];
2020
}
21-
else if(iArgs[0]==1&&(((v.x==iArgs[1]||v.x==iArgs[4])&&(v.y==iArgs[5]||v.y==iArgs[2])&&(v.z<=iArgs[6]&&v.z>=iArgs[3]||v.z<=iArgs[3]&&v.z>=iArgs[6]))||((v.z==iArgs[3]||v.z==iArgs[6])&&(v.y==iArgs[5]||v.y==iArgs[2])&&(v.x<=iArgs[4]&&v.x>=iArgs[1]||v.x<=iArgs[1]&&v.x>=iArgs[4]))||((v.z==iArgs[3]||v.z==iArgs[6])&&(v.x==iArgs[4]||v.x==iArgs[1])&&(v.y<=iArgs[5]&&v.y>=iArgs[2]||v.y<=iArgs[2]&&v.y>=iArgs[5])))){
21+
else if(iArgs[0]==1.&&(((v.x==iArgs[1]||v.x==iArgs[4])&&(v.y==iArgs[5]||v.y==iArgs[2])&&(v.z<=iArgs[6]&&v.z>=iArgs[3]||v.z<=iArgs[3]&&v.z>=iArgs[6]))||((v.z==iArgs[3]||v.z==iArgs[6])&&(v.y==iArgs[5]||v.y==iArgs[2])&&(v.x<=iArgs[4]&&v.x>=iArgs[1]||v.x<=iArgs[1]&&v.x>=iArgs[4]))||((v.z==iArgs[3]||v.z==iArgs[6])&&(v.x==iArgs[4]||v.x==iArgs[1])&&(v.y<=iArgs[5]&&v.y>=iArgs[2]||v.y<=iArgs[2]&&v.y>=iArgs[5])))){
2222
return iArgs[7];
2323
}
2424
else{
@@ -30,7 +30,7 @@ float map(vec3 v){
3030
float cte1=-1.;
3131
float a3=iArgs[4];
3232
float p1X,p1Y,p1Z,p2X,p2Y,p2Z;
33-
if(int(a3)&1){
33+
if(floor(a3/2.)*2.!=a3){
3434
cte=(a3-1.)/2.;
3535
cte1+=a3-cte;
3636
p1X=iArgs[1]-cte;
@@ -42,18 +42,18 @@ float map(vec3 v){
4242
}
4343
else{
4444
cte=a3/2.;
45-
cte1+=a3/2;
45+
cte1+=a3/2.;
4646
p1X=iArgs[1]-cte;
4747
p1Y=iArgs[2]-cte;
4848
p1Z=iArgs[3]-cte;
4949
p2X=iArgs[1]+cte1;
5050
p2Y=iArgs[2]+cte1;
5151
p2Z=iArgs[3]+cte1;
5252
}
53-
if(iArgs[0]==0&&((v.x>=p1X&&v.x<=p2X||v.x>=p2X&&v.x<=p1X)&&(v.y>=p1Y&&v.y<=p2Y||v.y>=p2Y&&v.y<=p1Y)&&(v.z>=p1Z&&v.z<=p2Z||v.z>=p2Z&&v.z<=p1Z))){
53+
if(iArgs[0]==0.&&((v.x>=p1X&&v.x<=p2X||v.x>=p2X&&v.x<=p1X)&&(v.y>=p1Y&&v.y<=p2Y||v.y>=p2Y&&v.y<=p1Y)&&(v.z>=p1Z&&v.z<=p2Z||v.z>=p2Z&&v.z<=p1Z))){
5454
return iArgs[5];
5555
}
56-
else if(iArgs[0]==1&&(((v.x==p1X||v.x==p2X)&&(v.y==p2Y||v.y==p1Y)&&(v.z<=p2Z&&v.z>=p1Z||v.z<=p1Z&&v.z>=p2Z))||((v.z==p1Z||v.z==p2Z)&&(v.y==p2Y||v.y==p1Y)&&(v.x<=p2X&&v.x>=p1X||v.x<=p1X&&v.x>=p2X))||((v.z==p1Z||v.z==p2Z)&&(v.x==p2X||v.x==p1X)&&(v.y<=p2Y&&v.y>=p1Y||v.y<=p1Y&&v.y>=p2Y)))){
56+
else if(iArgs[0]==1.&&(((v.x==p1X||v.x==p2X)&&(v.y==p2Y||v.y==p1Y)&&(v.z<=p2Z&&v.z>=p1Z||v.z<=p1Z&&v.z>=p2Z))||((v.z==p1Z||v.z==p2Z)&&(v.y==p2Y||v.y==p1Y)&&(v.x<=p2X&&v.x>=p1X||v.x<=p1X&&v.x>=p2X))||((v.z==p1Z||v.z==p2Z)&&(v.x==p2X||v.x==p1X)&&(v.y<=p2Y&&v.y>=p1Y||v.y<=p1Y&&v.y>=p2Y)))){
5757
return iArgs[5];
5858
}
5959
else{

0 commit comments

Comments
 (0)