Skip to content

Commit

Permalink
WIP4 v0.514
Browse files Browse the repository at this point in the history
  • Loading branch information
ozonexo3 committed Dec 21, 2017
1 parent c6ac252 commit 3aa91b3
Show file tree
Hide file tree
Showing 20 changed files with 529 additions and 138 deletions.
21 changes: 6 additions & 15 deletions Assets/GFX/Shaders/Backup/FaTerrainShader 1.shader
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ Properties {
_DepthLevel ("Depth Level", float) = 0.078125
_AbyssLevel ("Abyss Level", float) = 0.078125

[MaterialToggle] _Area("Area", Int) = 0
_AreaX ("Area X", Range (0, 2048)) = 0
_AreaY ("Area Y", Range (0, 2048)) = 0
_AreaWidht ("Area Widht", Range (0, 2048)) = 0
_AreaHeight ("Area Height", Range (0, 2048)) = 0

// set by terrain engine
_Control ("Control (RGBA)", 2D) = "black" {}
_ControlXP ("ControlXP (RGBA)", 2D) = "black" {}
Expand Down Expand Up @@ -174,11 +168,8 @@ Properties {
half _BrushUvX;
half _BrushUvY;

int _Area;
half _AreaX;
half _AreaY;
half _AreaWidht;
half _AreaHeight;
uniform int _Area;
uniform half4 _AreaRect;



Expand Down Expand Up @@ -399,19 +390,19 @@ Properties {
if(_Area > 0){
fixed3 BlackEmit = -1;
fixed3 Albedo = 0;
if(IN.worldPos.x < _AreaX){
if(IN.worldPos.x < _AreaRect.x){
o.Emission = BlackEmit;
o.Albedo = Albedo;
}
else if(IN.worldPos.x > _AreaWidht){
else if(IN.worldPos.x > _AreaRect.z){
o.Emission = BlackEmit;
o.Albedo = Albedo;
}
else if(IN.worldPos.z < _AreaY - _GridScale){
else if(IN.worldPos.z < _AreaRect.y - _GridScale){
o.Emission = BlackEmit;
o.Albedo = Albedo;
}
else if(IN.worldPos.z > _AreaHeight - _GridScale){
else if(IN.worldPos.z > _AreaRect.w - _GridScale){
o.Emission = BlackEmit;
o.Albedo = Albedo;
}
Expand Down
27 changes: 25 additions & 2 deletions Assets/GFX/Shaders/FaWater.shader
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Shader "MapEditor/FaWater" {
NormalSampler1 ("NormalSampler1", 2D) = "white" {}
NormalSampler2 ("NormalSampler2", 2D) = "white" {}
NormalSampler3 ("NormalSampler3", 2D) = "white" {}

_GridScale ("Grid Scale", Range (0, 2048)) = 512
//_WaterScaleX ("Water Scale X", float) = 1024
//_WaterScaleZ ("Water Scale Z", float) = 1024
}
Expand Down Expand Up @@ -71,8 +73,10 @@ Shader "MapEditor/FaWater" {
float SunGlow;

fixed4 waterColor, sunColor;


half _GridScale;

int _Area;
half4 _AreaRect;

//*********** End Water Params
sampler2D _WaterGrabTexture;
Expand All @@ -96,6 +100,7 @@ Shader "MapEditor/FaWater" {
float4 mScreenPos : TEXCOORD6;
float4 AddVar : TEXCOORD7;
float4 grabUV;
float3 worldPos;
};

void vert (inout appdata_full v, out Input o){
Expand Down Expand Up @@ -260,6 +265,24 @@ Shader "MapEditor/FaWater" {
clip(waterDepth - 0.01);


if(_Area > 0){
fixed3 BlackEmit = -1;
fixed3 Albedo = 0;
if(IN.worldPos.x < _AreaRect.x){
returnPixels.rgb = 0;
}
else if(IN.worldPos.x > _AreaRect.z){
returnPixels.rgb = 0;
}
else if(IN.worldPos.z < _AreaRect.y - _GridScale){
returnPixels.rgb = 0;
}
else if(IN.worldPos.z > _AreaRect.w - _GridScale){
returnPixels.rgb = 0;
}
}


o.Albedo = 0;
//color.rgb = exp2(-color.rgb);
o.Emission = returnPixels.rgb;
Expand Down
Binary file modified Assets/GFX/Terrain/ScmapTerrain.asset
Binary file not shown.
60 changes: 30 additions & 30 deletions Assets/GFX/Terrain/TerrainShader.mat
Original file line number Diff line number Diff line change
Expand Up @@ -231,22 +231,22 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AbyssLevel: 0.25
- _Area: 0
- _AreaHeight: 25.6
- _AreaWidht: 25.6
- _AbyssLevel: 0.3
- _Area: 1
- _AreaHeight: 128
- _AreaWidht: 204.8
- _AreaX: 0
- _AreaY: 0
- _AreaY: 76.8
- _Brush: 0
- _BrushSize: 0
- _BrushUvX: 0.12903841
- _BrushUvY: 0.35758018
- _BrushUvX: 0.85578656
- _BrushUvY: 0.053629737
- _DeepLevel: 1.675625
- _DepthLevel: 1.5
- _DepthLevel: 2
- _GeneratingNormal: 0
- _Grid: 0
- _GridCamDist: 0.049673967
- _GridScale: 102.4
- _GridScale: 51.2
- _HideSplat0: 0
- _HideSplat1: 0
- _HideSplat2: 0
Expand All @@ -257,32 +257,32 @@ Material:
- _HideSplat7: 0
- _HideSplat8: 0
- _LightingMultiplier: 1.27
- _LowerScale: 256
- _LowerScaleNormal: 117.02857
- _LowerScale: 128
- _LowerScaleNormal: 58.514286
- _Shininess: 0.03
- _Slope: 0
- _Splat0Scale: 256
- _Splat0ScaleNormal: 256
- _Splat1Scale: 292.57144
- _Splat1ScaleNormal: 89.04348
- _Splat2Scale: 60.952385
- _Splat2ScaleNormal: 512
- _Splat3Scale: 170.66667
- _Splat3ScaleNormal: 256
- _Splat4Scale: 256
- _Splat4ScaleNormal: 256
- _Splat5Scale: 256
- _Splat5ScaleNormal: 256
- _Splat6Scale: 256
- _Splat6ScaleNormal: 256
- _Splat7Scale: 256
- _Splat7ScaleNormal: 256
- _Splat0Scale: 128
- _Splat0ScaleNormal: 128
- _Splat1Scale: 128
- _Splat1ScaleNormal: 128
- _Splat2Scale: 128
- _Splat2ScaleNormal: 128
- _Splat3Scale: 128
- _Splat3ScaleNormal: 128
- _Splat4Scale: 128
- _Splat4ScaleNormal: 128
- _Splat5Scale: 128
- _Splat5ScaleNormal: 128
- _Splat6Scale: 128
- _Splat6ScaleNormal: 128
- _Splat7Scale: 128
- _Splat7ScaleNormal: 128
- _TTerrainXP: 0
- _UpperScale: 8
- _UpperScaleNormal: 1024
- _UpperScale: 4
- _UpperScaleNormal: 512
- _UseSlopeTex: 1
- _Water: 1
- _WaterLevel: 1.75
- _WaterLevel: 2.8
- _WaterScaleX: 1024
- _WaterScaleZ: 1024
m_Colors:
Expand Down
3 changes: 2 additions & 1 deletion Assets/GFX/Terrain/WaterShader.mat
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Material:
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Glossiness: 0.5
- _GridScale: 51.2
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
Expand All @@ -117,5 +118,5 @@ Material:
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- sunColor: {r: 0.26, g: 0.235, b: 0.175, a: 1}
- sunColor: {r: 0.40637136, g: 0.2370499, b: 0.16932134, a: 1}
- waterColor: {r: 0, g: 0.35, b: 0.75, a: 1}
Loading

0 comments on commit 3aa91b3

Please sign in to comment.