yes
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"version" : 1,
|
||||
"replacementkey" : "iris",
|
||||
"name" : "ui_editor_effect_depth_parallax_title",
|
||||
"description" : "ui_editor_effect_depth_parallax_description",
|
||||
"group" : "distort",
|
||||
"preview" : "preview/project.json",
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"material" : "materials/effects/depthparallax.json"
|
||||
}
|
||||
],
|
||||
"dependencies" :
|
||||
[
|
||||
"materials/effects/depthparallax.json",
|
||||
"shaders/effects/depthparallax.frag",
|
||||
"shaders/effects/depthparallax.vert"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"passes": [{
|
||||
"shader": "effects/depthparallax",
|
||||
"blending": "normal",
|
||||
"depthtest": "disabled",
|
||||
"depthwrite": "disabled",
|
||||
"cullmode": "nocull"
|
||||
}]
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"blending" : "translucent",
|
||||
"combos" :
|
||||
{
|
||||
"VERSION" : 2
|
||||
},
|
||||
"cullmode" : "nocull",
|
||||
"depthtest" : "disabled",
|
||||
"depthwrite" : "disabled",
|
||||
"shader" : "genericimage2",
|
||||
"textures" :
|
||||
[
|
||||
"mountain_peak_summit_altitude_top_extreme_mountaineering_trekking-892149"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"bleedtransparentcolors" : true,
|
||||
"clampuvs" : true,
|
||||
"format" : "rgba8888",
|
||||
"halfmip" : true,
|
||||
"nonpoweroftwo" : true
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"bleedtransparentcolors" : true,
|
||||
"clampuvs" : true,
|
||||
"format" : "r8",
|
||||
"halfmip" : true,
|
||||
"nomip" : true,
|
||||
"nonpoweroftwo" : true
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"autosize" : true,
|
||||
"material" : "materials/effectpreview.json"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"autosize" : true,
|
||||
"material" : "materials/mountain_peak_summit_altitude_top_extreme_mountaineering_trekking-892149.json"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"file" : "scene.json",
|
||||
"general" :
|
||||
{
|
||||
"properties" :
|
||||
{
|
||||
"schemecolor" :
|
||||
{
|
||||
"order" : 0,
|
||||
"text" : "ui_browse_properties_scheme_color",
|
||||
"type" : "color",
|
||||
"value" : "0 0 0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"title" : "preview",
|
||||
"type" : "scene",
|
||||
"version" : 0
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"camera" :
|
||||
{
|
||||
"center" : "0.00000 0.00000 0.00000",
|
||||
"eye" : "0.00000 0.00000 1.00000",
|
||||
"up" : "0.00000 1.00000 0.00000"
|
||||
},
|
||||
"general" :
|
||||
{
|
||||
"ambientcolor" : "0.30000 0.30000 0.30000",
|
||||
"bloom" : false,
|
||||
"bloomhdrfeather" : 0.10000000149011612,
|
||||
"bloomhdriterations" : 8,
|
||||
"bloomhdrscatter" : 1.6189999580383301,
|
||||
"bloomhdrstrength" : 2.0,
|
||||
"bloomhdrthreshold" : 1.0,
|
||||
"bloomstrength" : 2.0,
|
||||
"bloomthreshold" : 0.64999997615814209,
|
||||
"camerafade" : true,
|
||||
"cameraparallax" : true,
|
||||
"cameraparallaxamount" : 0.5,
|
||||
"cameraparallaxdelay" : 0.10000000149011612,
|
||||
"cameraparallaxmouseinfluence" : 1.0,
|
||||
"camerapreview" : true,
|
||||
"camerashake" : false,
|
||||
"camerashakeamplitude" : 0.5,
|
||||
"camerashakeroughness" : 1.0,
|
||||
"camerashakespeed" : 3.0,
|
||||
"clearcolor" : "0.70000 0.70000 0.70000",
|
||||
"clearenabled" : true,
|
||||
"farz" : 10000.0,
|
||||
"fov" : 50.0,
|
||||
"hdr" : false,
|
||||
"nearz" : 0.0099999997764825821,
|
||||
"orthogonalprojection" :
|
||||
{
|
||||
"height" : 600,
|
||||
"width" : 600
|
||||
},
|
||||
"skylightcolor" : "0.30000 0.30000 0.30000",
|
||||
"zoom" : 1.0
|
||||
},
|
||||
"objects" :
|
||||
[
|
||||
{
|
||||
"alignment" : "center",
|
||||
"alpha" : 1.0,
|
||||
"angles" : "0.00000 0.00000 0.00000",
|
||||
"brightness" : 1.0,
|
||||
"color" : "1.00000 1.00000 1.00000",
|
||||
"colorBlendMode" : 0,
|
||||
"copybackground" : true,
|
||||
"effects" :
|
||||
[
|
||||
{
|
||||
"file" : "effects/depthparallax/effect.json",
|
||||
"id" : 32,
|
||||
"name" : "",
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"combos" :
|
||||
{
|
||||
"QUALITY" : 2
|
||||
},
|
||||
"constantshadervalues" :
|
||||
{
|
||||
"center" : 0.23999999999999999,
|
||||
"scale" : "0.47 0.47",
|
||||
"sens" : 5
|
||||
},
|
||||
"id" : 33,
|
||||
"textures" :
|
||||
[
|
||||
null,
|
||||
"mountain_peak_summit_altitude_top_extreme_mountaineering_trekking-892149_depth"
|
||||
]
|
||||
}
|
||||
],
|
||||
"visible" : true
|
||||
}
|
||||
],
|
||||
"id" : 28,
|
||||
"image" : "models/mountain_peak_summit_altitude_top_extreme_mountaineering_trekking-892149.json",
|
||||
"ledsource" : false,
|
||||
"locktransforms" : false,
|
||||
"name" : "mountain_peak_summit_altitude_top_extreme_mountaineering_trekking-892149",
|
||||
"origin" : "110.44984 300.00000 0.00000",
|
||||
"parallaxDepth" : "0.00000 0.00000",
|
||||
"perspective" : false,
|
||||
"scale" : "0.91987 0.91987 0.91987",
|
||||
"size" : "1200.00000 674.00000",
|
||||
"solid" : true,
|
||||
"visible" : true
|
||||
}
|
||||
],
|
||||
"version" : 0
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
|
||||
// [COMBO] {"material":"ui_editor_properties_quality","combo":"QUALITY","type":"options","default":1,"options":{"ui_editor_properties_basic":0,"ui_editor_properties_occlusion_performance":1,"ui_editor_properties_occlusion_quality":2}}
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
|
||||
#if MASK
|
||||
varying vec2 v_TexCoordMask;
|
||||
#endif
|
||||
|
||||
uniform sampler2D g_Texture0; // {"hidden":true}
|
||||
uniform sampler2D g_Texture1; // {"label":"ui_editor_properties_depth_map","mode":"depth","format":"r8","default":"util/black","paintdefaultcolor":"0 0 0 1"}
|
||||
uniform sampler2D g_Texture2; // {"label":"ui_editor_properties_opacity_mask","mode":"opacitymask","combo":"MASK","paintdefaultcolor":"0 0 0 1"}
|
||||
|
||||
uniform vec2 g_Scale; // {"material":"scale","label":"ui_editor_properties_depth","default":"0.5 0.5","linked":true,"range":[0.01, 1.0]}
|
||||
uniform float g_Sensitivity; // {"material":"sens","label":"ui_editor_properties_perspective","default":2,"range":[0.01, 5.0]}
|
||||
uniform float g_Center; // {"material":"center","label":"ui_editor_properties_center","default":0.2,"range":[0.0, 1.0]}
|
||||
|
||||
uniform vec2 g_ParallaxPosition;
|
||||
|
||||
#if QUALITY != 0
|
||||
vec2 ParallaxMapping(vec2 texCoords, vec2 viewDir)
|
||||
{
|
||||
#if QUALITY == 1
|
||||
int numLayers = 24;
|
||||
#endif
|
||||
#if QUALITY == 2
|
||||
int numLayers = 64;
|
||||
#endif
|
||||
|
||||
float layerDepth = 1.0 / numLayers;
|
||||
float currentLayerDepth = 1.0;
|
||||
vec2 P = viewDir.xy * g_Scale * 0.1;
|
||||
vec2 deltaTexCoords = P / numLayers;
|
||||
|
||||
vec2 currentTexCoords = texCoords;
|
||||
float currentDepthMapValue = texSample2D(g_Texture1, currentTexCoords).r;
|
||||
|
||||
for (int i=0; currentLayerDepth > currentDepthMapValue && i<numLayers; i++)
|
||||
{
|
||||
currentTexCoords -= deltaTexCoords;
|
||||
currentDepthMapValue = texSample2D(g_Texture1, currentTexCoords).r;
|
||||
currentLayerDepth -= layerDepth;
|
||||
}
|
||||
|
||||
vec2 prevTexCoords = currentTexCoords + deltaTexCoords;
|
||||
|
||||
float afterDepth = currentDepthMapValue - currentLayerDepth;
|
||||
float beforeDepth = texSample2D(g_Texture1, prevTexCoords).r - currentLayerDepth - layerDepth;
|
||||
|
||||
float weight = afterDepth / (afterDepth - beforeDepth);
|
||||
vec2 finalTexCoords = prevTexCoords * weight + currentTexCoords * (1.0 - weight);
|
||||
|
||||
return finalTexCoords;
|
||||
}
|
||||
#endif
|
||||
|
||||
void main() {
|
||||
float depth = texSample2D(g_Texture1, v_TexCoord.zw).r;
|
||||
float mask = 1.0;
|
||||
|
||||
#if MASK
|
||||
mask *= texSample2D(g_Texture2, v_TexCoordMask.xy).r;
|
||||
#endif
|
||||
|
||||
#if QUALITY == 0
|
||||
vec2 pointer = vec2(v_TexCoord.z, 1.0 - v_TexCoord.w);
|
||||
pointer = (pointer - g_ParallaxPosition) * vec2(2.0, -2.0) * g_Scale * -0.04;
|
||||
vec2 offset = (depth * 2.0 - 1.0) * pointer * mask;
|
||||
vec4 albedo = texSample2D(g_Texture0, v_TexCoord.xy + offset);
|
||||
#else
|
||||
vec2 coords = v_TexCoord.xy - (g_ParallaxPosition * 2 - 1) * g_Center * vec2(-0.2, 0.2) * g_Scale;
|
||||
|
||||
vec2 pointer = vec2(1.0 - v_TexCoord.z, v_TexCoord.w);
|
||||
|
||||
vec2 fakeViewdir = (pointer - g_ParallaxPosition) * vec2(-g_Sensitivity, g_Sensitivity);
|
||||
vec2 newCoords = ParallaxMapping(coords, fakeViewdir * mask);
|
||||
//vec2 newCoords = parallax_uv(v_TexCoord.xy, vec3(fakeViewdir, 1));
|
||||
|
||||
|
||||
|
||||
vec4 albedo = texSample2D(g_Texture0, newCoords);
|
||||
#endif
|
||||
|
||||
gl_FragColor = albedo;
|
||||
|
||||
//gl_FragColor.rgb = vec3(pointer, 0);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
uniform mat4 g_ModelViewProjectionMatrix;
|
||||
|
||||
uniform vec4 g_Texture1Resolution;
|
||||
|
||||
#if MASK
|
||||
uniform vec4 g_Texture2Resolution;
|
||||
#endif
|
||||
|
||||
attribute vec3 a_Position;
|
||||
attribute vec2 a_TexCoord;
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
|
||||
#if MASK
|
||||
varying vec2 v_TexCoordMask;
|
||||
#endif
|
||||
|
||||
void main() {
|
||||
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
|
||||
v_TexCoord.xy = a_TexCoord.xy;
|
||||
|
||||
v_TexCoord.zw = vec2(a_TexCoord.x * g_Texture1Resolution.z / g_Texture1Resolution.x,
|
||||
a_TexCoord.y * g_Texture1Resolution.w / g_Texture1Resolution.y);
|
||||
|
||||
#if MASK
|
||||
v_TexCoordMask.xy = vec2(v_TexCoord.x * g_Texture2Resolution.z / g_Texture2Resolution.x,
|
||||
v_TexCoord.y * g_Texture2Resolution.w / g_Texture2Resolution.y);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "FX Preview",
|
||||
"type": "scene2d"
|
||||
}
|
||||
Reference in New Issue
Block a user