diff --git a/README.md b/README.md index be33b0b..ae3f790 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ # Eric's MagicaVoxel Shaders Shaders for MagicaVoxel including Terrain Generator, Advanced Flood System etc. +**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. + ## Internationalization -- 简体中文 - translated by CodingEric, target version: `0.0.9.0` +- 简体中文 - translated by CodingEric, target version: `0.1.0.0` - Français - translated by Pilou - Authorized reproduce, target version: `0.0.7.0` ## Project Info -* Current version: `0.0.9.9` +* Current version: `0.1.0.0` * State: `LTS` * Tested with `MagicaVoxel 0.99.3 for Windows` * Released under `MIT License` @@ -26,6 +28,9 @@ Copy the .txt files from the `shader` directory in this project to the `shader` | 0.99.2 | √ | | | 0.99.3 | √ | | +## Contribution +Feel free to make a PR as long as you've followed the contributing guidelines. + ## Shaders and usages >**Note**
- The parameters with `<>` can be ignored. Mostly, they are set to 0 as default.
- The shaders are not designed for selected areas without specific explanation.
- The documentation of deprecated/unstable shaders can be found in their folders. ### INDEX @@ -68,7 +73,7 @@ Copy the .txt files from the `shader` directory in this project to the `shader` ### CAVE back to index ->1. The 3d noise generator. +>1. This is the 3d noise generator. >2. The noise generation method is provided by ashima/webgl-noise: Copyright (C) 2011 Ashima Arts. All rights reserved. * File name: `cave.txt` * 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]` diff --git a/i18n/README-fr.md b/i18n/README-fr.md index 4415f93..f4e5246 100644 --- a/i18n/README-fr.md +++ b/i18n/README-fr.md @@ -13,11 +13,8 @@ Installez ces shaders en copiant les fichiers du répertoire shader de ce projet * Flow2 * Project * Life game -* Blanket * Cube filling * Flood -* [Unstable] Hyperflood -* [Deprecated] Darker Darker ### TERRAIN GENERATOR Retour au catalogue * Nom de fichier: `tergen.txt` diff --git a/i18n/README-sc.md b/i18n/README-sc.md index 2658822..b9c7072 100644 --- a/i18n/README-sc.md +++ b/i18n/README-sc.md @@ -6,7 +6,7 @@ 为MagicaVoxel设计的Shader,包含地形生成器,增强的洪流系统等。 ## 项目信息 -* 当前版本: `0.0.9.0` +* 当前版本: `0.1.0.0` * 状态: `长期支持` * 使用 `MagicaVoxel 0.99.3 for Windows` 测试 * 在 `MIT License` 下发行 @@ -31,6 +31,7 @@ ###

目录

* Terrain generator * Terrain generator 2 +* Cave * Flow * Flow2 * Project @@ -40,7 +41,7 @@ ### TERRAIN GENERATOR 回到目录 >1. 更旧的版本由于不支持一些古老的GLSL版本已经被舍弃,十分感谢bug提交者的贡献。 ->2. 噪波生成提供方为 ashima/webgl-noise: Copyright (C) 2011 Ashima Arts 保留所有权利 +>2. 噪波生成提供方为 ashima/webgl-noise: Copyright (C) 2011 Ashima Arts 保留所有权利。 * 文件名称: `tergen.txt` * 命令行用法: `xs tergen [seed] [altitude] [noise-scale] [voxel-color] ` @@ -55,7 +56,7 @@ ### TERRAIN GENERATOR 2 回到目录 >1. 在地形生成器2中,地形覆盖在已存在的体素上。 ->2. 噪波生成提供方为 ashima/webgl-noise: Copyright (C) 2011 Ashima Arts 保留所有权利 +>2. 噪波生成提供方为 ashima/webgl-noise: Copyright (C) 2011 Ashima Arts 保留所有权利。 * 文件名称: `tergen2.txt` * 命令行用法: `xs tergen2 [seed] [altitude] [noise-scale] [voxel-color] ` @@ -65,6 +66,18 @@ * 图片预览: +### CAVE +回到目录 +>1. 这是三维噪波生成器。 +>2. 噪波生成提供方为 ashima/webgl-noise: Copyright (C) 2011 Ashima Arts 保留所有权利。 +* 文件名称: `cave.txt` +* 命令行用法: `xs cave [seed] [noise-scale] [voxel-color] ` +* 命令行用法示例: `xs cave 19260817 75 1 -1 10 10 10` +* 命令行用法最简示例: `xs cave 19260817 75 1 -1` +>把 void-voxel-color 设置为 -1 将不会清空场景。 +* 图片预览: + + ### FLOW 回到目录 > 该shader模拟自然界中的水流效果。 diff --git a/shader/cubefill.txt b/shader/cubefill.txt index 9e8d6a6..1a85547 100644 --- a/shader/cubefill.txt +++ b/shader/cubefill.txt @@ -15,10 +15,10 @@ MIT License float map(vec3 v){ if(iArgs[6]!=0.){ - 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]))){ + 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]))){ return iArgs[7]; } - 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])))){ + 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])))){ return iArgs[7]; } else{ @@ -30,7 +30,7 @@ float map(vec3 v){ float cte1=-1.; float a3=iArgs[4]; float p1X,p1Y,p1Z,p2X,p2Y,p2Z; - if(int(a3)&1){ + if(floor(a3/2.)*2.!=a3){ cte=(a3-1.)/2.; cte1+=a3-cte; p1X=iArgs[1]-cte; @@ -42,7 +42,7 @@ float map(vec3 v){ } else{ cte=a3/2.; - cte1+=a3/2; + cte1+=a3/2.; p1X=iArgs[1]-cte; p1Y=iArgs[2]-cte; p1Z=iArgs[3]-cte; @@ -50,10 +50,10 @@ float map(vec3 v){ p2Y=iArgs[2]+cte1; p2Z=iArgs[3]+cte1; } - 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))){ + 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))){ return iArgs[5]; } - 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)))){ + 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)))){ return iArgs[5]; } else{