yes
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name" : "ui_editor_effect_xray_title",
|
||||
"description" : "ui_editor_effect_xray_description",
|
||||
"group" : "colorize",
|
||||
"preview" : "preview/project.json",
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"material" : "materials/effects/xray.json"
|
||||
}
|
||||
],
|
||||
"dependencies" :
|
||||
[
|
||||
"materials/effects/xray.json",
|
||||
"shaders/effects/xray.frag",
|
||||
"shaders/effects/xray.vert"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"blending" : "translucent",
|
||||
"cullmode" : "nocull",
|
||||
"depthtest" : "disabled",
|
||||
"depthwrite" : "disabled",
|
||||
"shader" : "genericimage2",
|
||||
"textures" : [ "effectpreview" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"clampuvs" : true,
|
||||
"format" : "rgba8888",
|
||||
"nomip" : true,
|
||||
"nonpoweroftwo" : true
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"passes": [{
|
||||
"shader": "effects/xray",
|
||||
"blending": "normal",
|
||||
"depthtest": "disabled",
|
||||
"depthwrite": "disabled",
|
||||
"cullmode": "nocull"
|
||||
}]
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"bleedtransparentcolors" : true,
|
||||
"clampuvs" : true,
|
||||
"format" : "rgba8888",
|
||||
"nonpoweroftwo" : true
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"autosize" : true,
|
||||
"material" : "materials/effectpreview.json"
|
||||
}
|
||||
17
modules/wallpaper-engine/effects/xray/preview/project.json
Normal file
17
modules/wallpaper-engine/effects/xray/preview/project.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"file" : "scene.json",
|
||||
"general" :
|
||||
{
|
||||
"properties" :
|
||||
{
|
||||
"schemecolor" :
|
||||
{
|
||||
"order" : 0,
|
||||
"text" : "ui_browse_properties_scheme_color",
|
||||
"type" : "color",
|
||||
"value" : "0 0 0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"title" : "preview"
|
||||
}
|
||||
68
modules/wallpaper-engine/effects/xray/preview/scene.json
Normal file
68
modules/wallpaper-engine/effects/xray/preview/scene.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"camera" :
|
||||
{
|
||||
"center" : "0.000 0.000 -1.000",
|
||||
"eye" : "0.000 0.000 0.000",
|
||||
"up" : "0.000 1.000 0.000"
|
||||
},
|
||||
"general" :
|
||||
{
|
||||
"ambientcolor" : "0.3 0.3 0.3",
|
||||
"bloom" : false,
|
||||
"bloomstrength" : 2,
|
||||
"bloomthreshold" : 0.64999997615814209,
|
||||
"cameraparallax" : false,
|
||||
"cameraparallaxamount" : 0.5,
|
||||
"cameraparallaxdelay" : 0.10000000149011612,
|
||||
"cameraparallaxmouseinfluence" : 0,
|
||||
"camerapreview" : true,
|
||||
"camerashake" : false,
|
||||
"camerashakeamplitude" : 0.5,
|
||||
"camerashakeroughness" : 1,
|
||||
"camerashakespeed" : 3,
|
||||
"clearcolor" : "0.7 0.7 0.7",
|
||||
"clearenabled" : null,
|
||||
"orthogonalprojection" :
|
||||
{
|
||||
"height" : 256,
|
||||
"width" : 256
|
||||
},
|
||||
"skylightcolor" : "0.3 0.3 0.3"
|
||||
},
|
||||
"objects" :
|
||||
[
|
||||
{
|
||||
"angles" : "0.000 0.000 0.000",
|
||||
"colorBlendMode" : 0,
|
||||
"copybackground" : true,
|
||||
"depth" : 1,
|
||||
"effects" :
|
||||
[
|
||||
{
|
||||
"file" : "effects/xray/effect.json",
|
||||
"passes" :
|
||||
[
|
||||
{
|
||||
"constantshadervalues" :
|
||||
{
|
||||
"ui_editor_particle_element_exponent" : 1.0,
|
||||
"ui_editor_properties_multiply" : 1.0
|
||||
},
|
||||
"textures" : [ null, "x-ray-1704855_960_720", "particle/halo" ]
|
||||
}
|
||||
],
|
||||
"username" : "",
|
||||
"visible" : true
|
||||
}
|
||||
],
|
||||
"id" : 38,
|
||||
"image" : "models/effectpreview.json",
|
||||
"name" : "",
|
||||
"origin" : "128.000 128.000 0.000",
|
||||
"parallaxDepth" : "1.000 1.000",
|
||||
"scale" : "1.000 1.000 1.000",
|
||||
"size" : "256.000 256.000",
|
||||
"visible" : true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
|
||||
// [COMBO] {"material":"ui_editor_properties_blend_mode","combo":"BLENDMODE","type":"imageblending","default":0}
|
||||
|
||||
#include "common_blending.h"
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
varying vec3 v_PointerUV;
|
||||
|
||||
uniform float g_Multiply; // {"material":"ui_editor_properties_multiply","default":1,"range":[0.0, 10.0]}
|
||||
uniform float g_PointerScale; // {"material":"ui_editor_particle_element_exponent","default":5,"range":[0.01, 20.0]}
|
||||
|
||||
#if OPACITYMASK == 1
|
||||
varying vec2 v_TexCoordOpacity;
|
||||
#endif
|
||||
|
||||
uniform sampler2D g_Texture0; // {"material":"ui_editor_properties_framebuffer","hidden":true}
|
||||
uniform sampler2D g_Texture1; // {"material":"ui_editor_properties_blend_texture","mode":"rgbmask","default":"util/white"}
|
||||
uniform sampler2D g_Texture2; // {"material":"ui_editor_properties_sprite","default":"particle/halo"}
|
||||
uniform sampler2D g_Texture3; // {"material":"ui_editor_properties_opacity_mask","mode":"opacitymask","default":"util/white","combo":"OPACITYMASK"}
|
||||
|
||||
|
||||
void main() {
|
||||
vec4 albedo = texSample2D(g_Texture0, v_TexCoord.xy);
|
||||
vec4 mask = texSample2D(g_Texture1, v_TexCoord.zw);
|
||||
float blend = mask.a * g_Multiply;
|
||||
|
||||
#if OPACITYMASK == 1
|
||||
blend *= texSample2D(g_Texture3, v_TexCoordOpacity).r;
|
||||
#endif
|
||||
|
||||
// Complete unproject per pixel
|
||||
vec2 unprojectedUVs = v_PointerUV.xy / v_PointerUV.z;
|
||||
|
||||
vec2 texS = v_TexCoord.xy;
|
||||
texS.y = 1.0 - texS.y;
|
||||
unprojectedUVs = (texS - unprojectedUVs);
|
||||
unprojectedUVs = saturate(unprojectedUVs);
|
||||
|
||||
// Scale sprite image around center
|
||||
unprojectedUVs -= 0.5;
|
||||
unprojectedUVs *= g_PointerScale;
|
||||
unprojectedUVs += 0.5;
|
||||
|
||||
vec2 blendSample = texSample2D(g_Texture2, unprojectedUVs).ra;
|
||||
blend *= blendSample.x * blendSample.y;
|
||||
|
||||
//blend = 0;
|
||||
//albedo.rgb = vec3(unprojectedUVs.xy, 0);
|
||||
|
||||
albedo.rgb = ApplyBlending(BLENDMODE, albedo.rgb, mask.rgb, blend);
|
||||
|
||||
gl_FragColor = albedo;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
|
||||
uniform mat4 g_ModelViewProjectionMatrix;
|
||||
uniform vec4 g_Texture1Resolution;
|
||||
|
||||
#if OPACITYMASK == 1
|
||||
uniform vec4 g_Texture3Resolution;
|
||||
|
||||
varying vec2 v_TexCoordOpacity;
|
||||
#endif
|
||||
|
||||
attribute vec3 a_Position;
|
||||
attribute vec2 a_TexCoord;
|
||||
|
||||
varying vec4 v_TexCoord;
|
||||
|
||||
uniform mat4 g_ModelViewProjectionMatrixInverse;
|
||||
|
||||
uniform vec4 g_Texture0Resolution;
|
||||
uniform vec2 g_PointerPosition;
|
||||
|
||||
varying vec3 v_PointerUV;
|
||||
|
||||
void main() {
|
||||
gl_Position = mul(vec4(a_Position, 1.0), g_ModelViewProjectionMatrix);
|
||||
v_TexCoord.xy = a_TexCoord;
|
||||
v_TexCoord.zw = vec2(v_TexCoord.x * g_Texture1Resolution.z / g_Texture1Resolution.x,
|
||||
v_TexCoord.y * g_Texture1Resolution.w / g_Texture1Resolution.y);
|
||||
|
||||
#if OPACITYMASK == 1
|
||||
v_TexCoordOpacity = vec2(v_TexCoord.x * g_Texture3Resolution.z / g_Texture3Resolution.x,
|
||||
v_TexCoord.y * g_Texture3Resolution.w / g_Texture3Resolution.y);
|
||||
#endif
|
||||
|
||||
vec2 pointer = g_PointerPosition;
|
||||
pointer.y = 1.0 - pointer.y; // Flip pointer screen space Y to match texture space Y
|
||||
v_PointerUV = mul(vec4(pointer * 2 - 1, 0.0, 1.0), g_ModelViewProjectionMatrixInverse).xyw;
|
||||
v_PointerUV.xy *= 1.0 / g_Texture0Resolution.xy;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "FX Preview",
|
||||
"type": "scene2d"
|
||||
}
|
||||
Reference in New Issue
Block a user