summaryrefslogtreecommitdiff
path: root/Data/Scripts/Editor/AssetBrowser.lua
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-10-30 22:59:42 +0800
committerchai <chaifix@163.com>2021-10-30 22:59:42 +0800
commit26f05c6e3dcac9995345fb5a2b031be7e3ea79e9 (patch)
treefc32c3e9d235817df0be331a6100b7f8263facab /Data/Scripts/Editor/AssetBrowser.lua
parentc3e259f4d29e9bdcb73617ad8e4d71f117b4d289 (diff)
*TextGenerator
Diffstat (limited to 'Data/Scripts/Editor/AssetBrowser.lua')
-rw-r--r--Data/Scripts/Editor/AssetBrowser.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/Data/Scripts/Editor/AssetBrowser.lua b/Data/Scripts/Editor/AssetBrowser.lua
index a36cda2..68f0483 100644
--- a/Data/Scripts/Editor/AssetBrowser.lua
+++ b/Data/Scripts/Editor/AssetBrowser.lua
@@ -42,7 +42,11 @@ out vec4 FragColor;
void main()
{
- FragColor = texture(uiTex, uv);
+ vec4 sampled = vec4(texture(uiTex, uv).r, 0, 0, 1.0);
+ FragColor = sampled;
+// FragColor = texture(uiTex, uv);
+// FragColor.rgb = vec3(1,0,0);
+// FragColor.a = 1;
}
FSH_END
@@ -52,6 +56,7 @@ local tex
AssetBrowser.OnGUI = function(self)
+
if tex == nil then
tex = Engine.Resource.LoadTexture("./Resources/Images/brickwall.jpg")
end
@@ -76,7 +81,7 @@ AssetBrowser.OnGUI = function(self)
Engine.Rendering.UseShader(shader)
Engine.Rendering.SetMatrix44("mvp", ortho)
- Engine.Rendering.SetTexture("tex", tex)
+ Engine.Rendering.SetTexture("uiTex", tex)
Engine.Rendering.DrawUIQuad({10, 30, 300, 300})
Engine.Rendering.ResetUniformState()