mirror of
https://github.com/CDevJoud/Minecraft-Community-Edition.git
synced 2026-07-16 05:20:56 +00:00
testing the RmlUI
This commit is contained in:
@@ -66,7 +66,7 @@ namespace mce {
|
||||
}
|
||||
|
||||
eastl::vector<uint8_t> mem;
|
||||
vfs.getFile("assets.images.aya", mem);
|
||||
vfs.getFile("assets.images.who", mem);
|
||||
|
||||
renderState.texture = factory.createTexture(mem);
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace mce {
|
||||
cube.setTexture(renderState.texture);
|
||||
|
||||
torus.create(qBus, factory, 10, 5, 128, 128, gfx::Color::Black);
|
||||
|
||||
//torus.createPlane(qBus, factory, 100, 100, 20, 20, gfx::Color::Black);
|
||||
torus.setTexture(renderState.texture);
|
||||
}
|
||||
|
||||
@@ -133,10 +133,11 @@ namespace mce {
|
||||
|
||||
torus.position.z = 20.0f;
|
||||
//torus.rotation.x = 310 * (3.14 / 180);
|
||||
torus.rotation.y += 0.00045f;
|
||||
torus.rotation.x += 0.00015f;
|
||||
torus.rotation.y += 10 * (3.14 / 180);
|
||||
torus.rotation.x += 10 * (3.14 / 180);
|
||||
//torus.rotation.z += 0.0035f;
|
||||
//renderer.render(cube);
|
||||
renderer.render(torus);
|
||||
}
|
||||
}
|
||||
//-config ../data/launcher/launcher.xml --renderer d3d11
|
||||
@@ -53,9 +53,11 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, \
|
||||
|
||||
#define MCE_STARTUP(_Startup) \
|
||||
int main(int argc, char* argv[]) { \
|
||||
_Startup app(argc, argv); \
|
||||
int nExitCode = app.run(); \
|
||||
TerminateProcess(GetCurrentProcess(), nExitCode); \
|
||||
int nExitCode = 0x00; { \
|
||||
_Startup app(argc, argv); \
|
||||
nExitCode = app.run();\
|
||||
}\
|
||||
ExitProcess(nExitCode);\
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
88
Minecraft-Community-Edition/shader2vfs.py
Normal file
88
Minecraft-Community-Edition/shader2vfs.py
Normal file
@@ -0,0 +1,88 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# CONFIG
|
||||
# ------------------------------------------------------------
|
||||
|
||||
MANIFEST_PATH = "assets.json"
|
||||
SHADER_FOLDER = "./assets/shaders"
|
||||
OUTPUT_JSON = "assets.json"
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# LOAD EXISTING MANIFEST
|
||||
# ------------------------------------------------------------
|
||||
|
||||
manifest = {}
|
||||
|
||||
manifest_file = Path(MANIFEST_PATH)
|
||||
|
||||
if manifest_file.exists():
|
||||
with open(manifest_file, "r", encoding="utf-8") as f:
|
||||
manifest = json.load(f)
|
||||
|
||||
print(f"Loaded {len(manifest)} existing entries")
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# FILE TAG GENERATION
|
||||
# ------------------------------------------------------------
|
||||
|
||||
|
||||
def generate_filetag(shader_path: Path) -> str:
|
||||
"""
|
||||
Converts:
|
||||
|
||||
assets/shaders/main.fs.d3d11_windows.bin
|
||||
|
||||
Into:
|
||||
|
||||
assets.shaders.main.fs.d3d11_windows
|
||||
"""
|
||||
|
||||
# Remove extension (.bin)
|
||||
no_ext = shader_path.with_suffix("")
|
||||
|
||||
# Convert path separators to dots
|
||||
parts = no_ext.parts
|
||||
|
||||
return ".".join(parts)
|
||||
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# SCAN SHADER DIRECTORY
|
||||
# ------------------------------------------------------------
|
||||
|
||||
shader_root = Path(SHADER_FOLDER)
|
||||
|
||||
if not shader_root.exists():
|
||||
raise RuntimeError(f"Shader folder does not exist: {SHADER_FOLDER}")
|
||||
|
||||
added_count = 0
|
||||
|
||||
for shader_file in shader_root.rglob("*.bin"):
|
||||
|
||||
# Generate tag
|
||||
filetag = generate_filetag(shader_file)
|
||||
|
||||
# Convert to windows-style relative path
|
||||
relative_path = ".\\" + str(shader_file).replace("/", "\\")
|
||||
|
||||
# Add only if missing
|
||||
if filetag not in manifest:
|
||||
manifest[filetag] = relative_path
|
||||
added_count += 1
|
||||
|
||||
print(f"Added: {filetag}")
|
||||
print(f" -> {relative_path}")
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# SAVE JSON
|
||||
# ------------------------------------------------------------
|
||||
|
||||
with open(OUTPUT_JSON, "w", encoding="utf-8") as f:
|
||||
json.dump(manifest, f, indent=4)
|
||||
|
||||
print()
|
||||
print(f"Added {added_count} new shaders")
|
||||
print(f"Total shaders: {len(manifest)}")
|
||||
print(f"Saved manifest to: {OUTPUT_JSON}")
|
||||
@@ -7,6 +7,7 @@ REM Right now the only way to get the shader compiler is to build it from src fr
|
||||
set SC=D:\Void\bgfx\bin\shadercRelease
|
||||
set INCLUDE=%ROOT%\libs\bgfx\
|
||||
set SHADERS=%ROOT%\Graphics\Shaders
|
||||
set RMLSHADERS=%ROOT%\UI\Backend\shaders
|
||||
set OUT=%ROOT%\assets\shaders
|
||||
goto :gen
|
||||
|
||||
@@ -17,9 +18,23 @@ REM %3 = profile
|
||||
:compile
|
||||
echo Compiling %2 for %1...
|
||||
|
||||
REM Graphics default shader
|
||||
%SC% -f %SHADERS%\main.vs -o %OUT%\main.vs.%2_%1.bin --type v --platform %1 -p %3 -i %INCLUDE%
|
||||
%SC% -f %SHADERS%\main.fs -o %OUT%\main.fs.%2_%1.bin --type f --platform %1 -p %3 -i %INCLUDE%
|
||||
|
||||
REM RmlUI shaders
|
||||
%SC% -f %RMLSHADERS%\rmlui.vs -o %OUT%\rmlui.vs.%2_%1.bin --type v --platform %1 -p %3 %INCLUDE%
|
||||
%SC% -f %RMLSHADERS%\rmlui_passthrough.vs -o %OUT%\rmlui_passthrough.vs.%2_%1.bin --type v --platform %1 -p %3 %INCLUDE%
|
||||
%SC% -f %RMLSHADERS%\rmlui_blendmask.fs -o %OUT%\rmlui_blendmask.fs.%2_%1.bin --type f --platform %1 -p %3 %INCLUDE%
|
||||
%SC% -f %RMLSHADERS%\rmlui_blur.fs -o %OUT%\rmlui_blur.fs.%2_%1.bin --type f --platform %1 -p %3 %INCLUDE%
|
||||
%SC% -f %RMLSHADERS%\rmlui_color.fs -o %OUT%\rmlui_color.fs.%2_%1.bin --type f --platform %1 -p %3 %INCLUDE%
|
||||
%SC% -f %RMLSHADERS%\rmlui_colormatrix.fs -o %OUT%\rmlui_colormatrix.fs.%2_%1.bin --type f --platform %1 -p %3 %INCLUDE%
|
||||
%SC% -f %RMLSHADERS%\rmlui_creation.fs -o %OUT%\rmlui_creation.fs.%2_%1.bin --type f --platform %1 -p %3 %INCLUDE%
|
||||
%SC% -f %RMLSHADERS%\rmlui_dropshadow.fs -o %OUT%\rmlui_dropshadow.fs.%2_%1.bin --type f --platform %1 -p %3 %INCLUDE%
|
||||
%SC% -f %RMLSHADERS%\rmlui_gradient.fs -o %OUT%\rmlui_gradient.fs.%2_%1.bin --type f --platform %1 -p %3 %INCLUDE%
|
||||
%SC% -f %RMLSHADERS%\rmlui_passthrough.fs -o %OUT%\rmlui_passthrough.fs.%2_%1.bin --type f --platform %1 -p %3 %INCLUDE%
|
||||
%SC% -f %RMLSHADERS%\rmlui_texture.fs -o %OUT%\rmlui_texture.fs.%2_%1.bin --type f --platform %1 -p %3 %INCLUDE%
|
||||
|
||||
goto :eof
|
||||
|
||||
:gen
|
||||
|
||||
Reference in New Issue
Block a user