- Joined
- Nov 29, 2014
- Messages
- 191
I think many people have seen the Nirvana project where the author has implemented Normal Mapping, Shadow Volume, and various post-effects. I decided to continue his work.
RenderEdge is a modification for Warcraft III, aimed first and foremost at improving the graphical components of the game by implementing a newer version of the graphics API. |
Features
- GUI Rendering System:
- (+) Base system;
- (+) Multi-line text with formatting;
- (+) TTF fonts support;
- (+) Jass handling;
- Post-processing:
- (+) HDR rendering;
- (+) ACES Tonemapping and Color Grading;
- (+) Screen Space Reflections;
- (+) Contact Shadows;
- (+) Subpixel Morphological and Temporal Anti-Aliasing;
- (+) Support of custom shaders;
- (-) Jass handling;
- Advanced Lighting:
- (+) Cascaded Shadow Mapping;
- (+) Physically Based Shading;
- (+) Image Based Lighting;
- (+) Gamma Correction;
- (+) Support of custom shaders;
- (-) Jass handling;
- Misc:
- (+) Direct3D8 to Direct3D9;
- (+) Widescreen support;
- (+) Lower delay for unit orders in singleplayer;
- (+) Launching more than one instance of war3.exe;
- (+) Turning on/off V-Sync.
Requirements:
- WarCraft III patch 1.26a;
- Windows 7 or above;
- Microsoft Visual C++ Redistributable for Visual Studio 2017.
Press F7 to show settings GUI. You can also edit settings via RenderEdge.ini.
You can enable the option to load shaders and textures from the RenderEdge folder by editing this value in the Registry Editor: CURRENT_USER\Software\RenderEdge\AllowLocalFiles. Resource search sequence: the loaded map, the RenderEdge folder, the RenderEdge.mpq archive.
You can add new tab in your JNGP to launch RenderEdge easier by editing wehack.lua:
PHP:
-- # begin RenderEdge #
RenderEdgePath = grim.getregpair("HKEY_CURRENT_USER\\Software\\RenderEdge", "InstallPath")
haveRenderEdge = grim.exists(RenderEdgePath .. "\\RenderEdge.exe")
function toggleRenderEdgeDebug(checked)
if checked then
grim.setregdword("HKEY_CURRENT_USER\\Software\\RenderEdge", "Debug", 1)
else
grim.setregdword("HKEY_CURRENT_USER\\Software\\RenderEdge", "Debug", 0)
end
end
function toggleRenderEdgeAllowLocalFiles(checked)
if checked then
grim.setregdword("HKEY_CURRENT_USER\\Software\\RenderEdge", "AllowLocalFiles", 1)
else
grim.setregdword("HKEY_CURRENT_USER\\Software\\RenderEdge", "AllowLocalFiles", 0)
end
end
if haveRenderEdge then
RenderEdgeMenu = wehack.addmenu("RenderEdge")
RenderEdgeEnabled = TogMenuEntry:New(RenderEdgeMenu, "Run with RenderEdge", nil, true)
RenderEdgeDebug = TogMenuEntry:New(RenderEdgeMenu, "Debug Mode",
function(self) toggleRenderEdgeDebug(self.checked) end, false)
if grim.getregpair("HKEY_CURRENT_USER\\Software\\RenderEdge", "Debug") == 1 then
wehack.checkmenuentry(RenderEdgeMenu, RenderEdgeDebug, 1)
else
wehack.checkmenuentry(RenderEdgeMenu, RenderEdgeDebug, 0)
end
RenderEdgeAllowLocalFiles = TogMenuEntry:New(RenderEdgeMenu, "Allow Local Files",
function(self) toggleRenderEdgeAllowLocalFiles(self.checked) end, false)
if grim.getregpair("HKEY_CURRENT_USER\\Software\\RenderEdge", "AllowLocalFiles") == 1 then
wehack.checkmenuentry(RenderEdgeMenu, RenderEdgeAllowLocalFiles, 1)
else
wehack.checkmenuentry(RenderEdgeMenu, RenderEdgeAllowLocalFiles, 0)
end
end
-- # end RenderEdge #
function testmap(cmdline)
if haveRenderEdge and RenderEdgeEnabled.checked then
local pos = string.find(cmdline, ".exe")
cmdline = string.sub(cmdline, 5 + pos)
cmdline = RenderEdgePath .. "RenderEdge.exe " .. cmdline
end
if wh_opengl.checked then
cmdline = cmdline .. " -opengl"
end
if wh_window.checked then
cmdline = cmdline .. " -window"
end
wehack.execprocess(cmdline)
end
Shaders editing
If you want to edit shaders, download archive, unpack, compile and place them in Shaders folder. Then you can place it in RenderEdge folder, import in your map or in RenderEdge_exp.mpq archive.
Compiling in Visual Studio:
Add the shaders to the project and configure the HLSL Compiler in the project properties as follows:
Compiling by fxc.exe:
Code:
@echo off
fxc.exe /T fx_2_0 /Fo Standard.cso Shaders\Standard.fx /nologo
fxc.exe /T fx_2_0 /Fo Shadows.cso Shaders\Shadows.fx /nologo
fxc.exe /T fx_2_0 /Fo PostProcess.cso Shaders\PostProcess.fx /nologo
fxc.exe /T fx_2_0 /Fo Skybox.cso Shaders\Skybox.fx /nologo
pause
Custom Natives
JASS:
// TriggerRegisterMouseEvent & TriggerRegisterKeyEvent
constant integer MB_Left = 0
constant integer MB_Middle = 1
constant integer MB_Right = 2
constant integer MB_X1 = 3
constant integer MB_X2 = 4
constant integer KEY_Any = -1
constant integer EVENT_Down = 0
constant integer EVENT_Up = 1
// CtrlSetAnchor & SetPortrait
constant integer ANCHOR_TOPLEFT = 0
constant integer ANCHOR_TOP = 1
constant integer ANCHOR_TOPRIGHT = 2
constant integer ANCHOR_LEFT = 3
constant integer ANCHOR_CENTER = 4
constant integer ANCHOR_RIGHT = 5
constant integer ANCHOR_BOTTOMLEFT = 6
constant integer ANCHOR_BOTTOM = 7
constant integer ANCHOR_BOTTOMRIGHT = 8
native GetMouseX takes nothing returns integer
native GetMouseY takes nothing returns integer
native GetMouseXRelative takes nothing returns integer
native GetMouseYRelative takes nothing returns integer
native GetMouseTerrainX takes nothing returns real
native GetMouseTerrainY takes nothing returns real
native GetMouseTerrainZ takes nothing returns real
native IsMouseOverUI takes nothing returns boolean
native BlockMouse takes boolean bBlock returns nothing
native GetWheelDelta takes nothing returns integer
native SetMousePos takes integer x, integer y returns nothing
native TriggerRegisterMouseWheelEvent takes trigger trig returns nothing
native TriggerRegisterMouseMoveEvent takes trigger trig returns nothing
native TriggerRegisterMouseEvent takes trigger trig, integer iButton, integer state returns nothing
native GetTriggerKey takes nothing returns integer
native IsKeyDown takes integer iKey returns boolean
native TriggerRegisterKeyEvent takes trigger trig, integer iKey, integer state returns nothing
native GetWindowWidth takes nothing returns integer
native GetWindowHeight takes nothing returns integer
native GetWindowX takes nothing returns integer
native GetWindowY takes nothing returns integer
native TriggerRegisterWindowResizeEvent takes trigger trig returns nothing
native CtrlNew takes integer id, integer offsetX, integer offsetY, integer width, integer height returns nothing
native CtrlSetText takes integer id, string text, boolean bWrap returns nothing
native CtrlSetColor takes integer id, integer argb returns nothing
native CtrlSetTexture takes integer instID, string filename returns nothing
native CtrlSetSize takes integer id, integer width, integer height returns nothing
native CtrlSetAnchor takes integer id, integer parentId, integer anchor returns nothing
native CtrlSetPosition takes integer id, integer offsetX, integer offsetY returns nothing
native CtrlShow takes integer id, boolean isShow returns nothing
native CtrlSetDepth takes integer id, real fDepth returns nothing
native CtrlSetAngle takes integer id, real fAngle returns nothing
native CtrlGetWidth takes integer id returns integer
native CtrlGetHeight takes integer id returns integer
native CtrlGetFromPoint takes integer x, integer y returns integer
native CtrlIsText takes integer id returns boolean
native CtrlSetFont takes integer id, string name, integer size returns nothing
native GUILoadFont takes string name returns nothing
native GetFPS takes nothing returns real
native GetDeltaTime takes nothing returns real
native COLOR_ARGB takes integer a, integer r, integer g, integer b returns integer
native EnableVsync takes boolean bEnable returns nothing
native TriggerRegisterFrameUpdateEvent takes trigger trig returns nothing
native SetBlackBorders takes real upper, real bottom returns nothing
native SetPortrait takes integer anchor, integer x, integer y, integer width, integer height returns nothing
native IsGamePaused takes nothing returns boolean
N/A
N/A
Samples
Sample map is written in vJass and contains demonstration of using all RenderEdge features. The map is updated every time a new version of RenderEdge is released.
Map features:
|
Changelog
Follow the development progress in Trello.
Code:
v0.3.0
* Merged experimental and basic versions;
* Added support of Cine Filter;
* Added EnvBRDF function;
* Added Terrain shader;
* Loading .ini file from RenderEdge folder without AllowLocalFiles flag;
* Added Reload Shaders button;
* Updated Bloom effect;
* Fixed Direct3DCreate8 hooking issues;
* Fixed searching war3.exe bug in launcher;
* Fixed shadows quality;
* Fixed shadows far clip bound;
* Fixed screenshots names and missing extensions;
* Fixed Post Processing rendering while map loading.
v0.2.7a
* Updated RenderStage Controller (improved hooking of standard interface rendering);
* Fixed bugs in JassAPI (wrong real <=> float convertation);
* Fixed bugs in CtrlSetDepth and CtrlSetAngle functions;
* Fixed sliders and checkboxes in sample map;
* Added descriptions of .exe and .dll files.
v0.2.6a
* Removed 512p limit in .blp textures (thanks to Karaulov);
* Added new native function CtrlSetZOrder;
* Added new native function EnableAnisoFiltering;
* Added new native function HideInterface;
* Added new native functions: EditMinimap, EditCommandBarButton, EditHeroBarButton, EditItemBarButton, EditMinimapButton, EditUpperButtonBarButton;
* Changed SetPortrait and SetBlackBorders function names to EditPortrait and EditBlackBorders;
* Fixed a lot of bugs in RenderEdge_loader.dll and RenderEdge.exe;
* Fixed incorrect line breaking in wrapped text that uses the "|n" control character;
* Fixed a lot of bugs in GUI system (e.g. bug in CtrlSetTexture function, bug then restarting map);
* Optimized GUI system. Some functions was rewritten from scratch;
* Optimized Font and Texture Managers;
* Updated detours.lib and libjpeg.lib to latest version;
* Improved and optimized debug log.
v0.2.5a
* Added new native function GUILoadFont;
* Added new native function CtrlSetFont;
* Deleted GUISetFont function;
* Fixed crashes when setting some fonts (e.g. "Times New Roman");
* Fixed the height of single-line text;
v0.2.4a
* Added new native function SetPortrait;
* CtrlSetSize function does not change the width or height if you set the corresponding argument to -1;
* Changed CtrlSetAlignment function name to CtrlSetAnchor;
* Changed HP Bars fix;
* Fixed dynamic controls alignment relative to other UI elements;
* Fixed height of the wrapped text;
* Fixed the height of the wrapped text when the width was changed dynamically;
* Fixed safety issues. If a bold, italic or bold italic font is not available, then a normal font is used.
v0.2.3b
* Fixed alignment relative to other UI elements.
v0.2.3a
* Added new native function CtrlSetSize;
* Added new native function CtrlSetAlignment;
* CtrlSetPosition and CtrlNew functions now take offsetX and offsetY instead of x and y;
* Deleted CtrlSetRect function.
v0.2.2a
* Updated Direct3D8 calls interceptor;
* Added new native function IsGamePaused;
* Added new native function SetBlackBorders;
* Updated Jass API, fixed some bugs with custom natives;
* Fixed native functions that take boolean arguments;
* Fixed re-adding triggers by TriggerRegister#Event functions after map restart;
* EnableVsync function now works without the need to minimize the game;
* Fixed an issue where new GUI elements did not have default green texture;
* Improved debug log. The log file is cleared if the size has exceeded 100 KB.
v0.2.1b
* Fixed crashes when calling CtrlSetText, CtrlSetTexture and GUISetFont functions (converting UTF-8 to ASCII problem);
* Removed non-stable feature from previous version: "Removed the default lower limit of the camera target distance";
* Updated FreeType to 2.8;
* Updated RenderEdge_loader.dll. Now it is looking for RenderEdge_exp.dll, if it is not found, then loading RenderEdge.dll;
* GUI system optimization;
* Widescreen fix optimization;
* Added a counter of memory used by the Warcraft;
* Optimizing the debug log. The debugging system was rewritten from scratch.
v0.2.1a
* Updated Widescreen Fix. The vertical FoV is no longer dependent on the screen width;
* FPS is unlocked, now it can be above 64 with disabled vsync (thanks to Karaulov);
* Removed the default lower limit of the camera target distance (now it can be set to 0.01);
* Using more precision depth buffer format if supported. Use SetCameraField(ConvertCameraField(7), value, time) to set the near clipping plane of camera (100.0 by default);
* Added new native function TriggerRegisterFrameUpdateEvent. The function is called every frame (delay less than 0.001 seconds);
* Added new native function EnableVsync (enabled by default);
* Added new native functions GetWindowX() and GetWindowY();
* Added new native functions GetMouseXRelative and GetMouseYRelative;
* GetMouseX and GetMouseY functions now return coordinates without clippping by window;
* Changed FPS function name to GetFPS;
* Changed DeltaTime function name to GetDeltaTime;
* GetDeltaTime function now returns seconds instead of milliseconds;
* Improved debug log. The log file is cleared if the size has exceeded 1 MB.
v0.2.0a
* Direct3D9 support;
* Blocking CtrlGetFromPoint function while game is paused;
* Showing the GUI only after the map loading;
* Fixed a problem that the width and height of the texture were confused;
* Fixed too large FoV of camera when Widescreen Fix is used;
* Fixed an issue where it was not possible to launch the application on the first try;
* Updated FreeType to 2.7;
* Launching more than one instance of war3.exe;
* RenderEdge.dll optimization;
* Fixed safety issues;
* Updated project logo and added app icon;
* Improved debug log.
v0.1.0a
* Implemented correctly receiving information from jass string (support of other languages in addition to English);
* Implemented widescreen support;
* Changed CtrlCreateInstance function name to CtrlNew;
* Changed CtrlSetText(int id, bool autoResize, string text) function to CtrlSetText(int id, string text, bool bWrap);
* Changed CtrlGetFromMousePoint() function to CtrlGetFromPoint(int x, int y);
* Added new native function GUISetFont;
* Added new native function CtrlIsText;
* IsMouseOverUI function now work properly;
* Removed CtrlSetSolidColor function, use white texture ("Textures\\white.blp") and CtrlSetColor(int argb) instead;
* Fixed launcher issue associated with the impossibility to run RenderEdge after the reinstallation of Warcraft to different path;
* Added TTF fonts support using FreeType (www.freetype.org);
* Added multi-line text and formatting support: "|n" (to new line), "|cAARRGGBB" (color), "|b" (bold), "|i" (italic), "|r" (reset font and color to default);
* Lower delay for unit orders in Singleplayer;
* Added project logo;
* Reduced size of RenderEdge.mpq;
* Improved debug log.
v0.0.3a
* Implemented reading settings from the registry;
* Added CtrlGetHeight and CtrlGetWidth functions;
* Fixed stretching health bars on widescreen;
* Disabled EnableDebug function, now debug mode is activated from the registry editor;
* Improved compatibility with JNGP;
* Improved debug log.
v0.0.2b
* Fixed an issue where it was not possible to launch the application on the first try;
* Improved debug log.
v0.0.2a
* Fixed RenderEdge.mpq loading issue (now mod can be placed in any folder);
* Fixed bug in CtrlSetText function then all controls that use the font texture have the same text;
* Changed CtrlSetText function - removed "argb" argument responsible for the color of created text, use CtrlSetColor function instead (the default color is white);
* Changed CtrlSetDepth function - type of "depth" argument changed to real;
* Added new native function CtrlSetAngle.
* Removed CtrlSetCallback function.
v0.0.1a
* First stable version.
References
Attachments
Last edited: