[RenderEdge] Experimental version

Status
Not open for further replies.
Level 9
Joined
Nov 29, 2014
Messages
191
Basic version | Widescreen Fix | Memory Hack

The experimental version is no longer supported, use basic version.

Introduction



logo.png


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.
The RenderEdge project is divided into two versions: basic and experimental. All that you will be able to do in the experimental version will eventually be implemented in the main.


Features


  • (+) Cascaded Shadow Mapping;
  • (+) Physically Based Shading;
  • (+) Gamma Correction;
  • (+) ACES Tonemapping and Color Grading;
  • (+) Screen Space Reflections;
  • (+) Temporal Anti-Aliasing;
  • (+) Support of custom shaders for post-effects and models;
  • (-) Using models from .obj, .3ds, .dae and .blend files;
  • (-) MDX/MDL models format modification: adding support of normal maps and DDS/BLP2 texture format
  • (-) War3 Model Editor modification;
  • (-) Adding new features to the World Editor;

Bugs:
  • Some post-effects work incorrectly with a limited size of viewport.


Installation


Requirements:
Unpack archive and launch RenderEdge.exe. Press F7 to show settings GUI. You can also edit settings via RenderEdge.ini (placed in RenderEdge_exp.mpq archive).

You can enable the option to load settings file, 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_exp.mpq archive.

You can add new tab in your JNGP to launch RenderEdge easier by editing wehack.lua:

Code:
-- # 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:
Capture.png

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



Screenshots


RenderEdge_110718_075753_08.png RenderEdge_110718_075646_06.png RenderEdge_110718_075230_02.pngRenderEdge_110718_075212_01.png RenderEdge_110718_075315_03.png
war3 2017-06-14 17-23-23-63.png PBS 4.png Normals On.png

Nirvana_2015-09-26_17-12-48.png

Nirvana_2015-09-26_17-13-55.png

Nirvana_2015-09-26_17-17-45.png

Nirvana_2015-09-26_17-25-58.png

Nirvana_2015-09-26_17-27-35.png

Nirvana_2015-10-11_18-56-00.png

Nirvana_2015-10-11_18-57-17.png

Nirvana_2015-10-11_19-08-37.png

Nirvana_2015-10-11_19-08-47.png

Nirvana_2015-10-11_19-16-17.png

WC3ScrnShot_121915_092338_01.png

WC3ScrnShot_120815_200747_01.png

WC3ScrnShot_120815_205921_11.png

WC3ScrnShot_120815_205924_13.png

WC3ScrnShot_120815_210759_01.png

Nirvana_2015-12-26_18-04-04.png

Nirvana_2015-12-26_18-04-09.png

Nirvana_2016-01-05_21-39-33.png

Nirvana_2016-01-05_21-39-41.png

Nirvana_2016-01-05_21-39-47.png

8kAGQyS.png

JSVRaG7.png

Gm8EERp.png

screen.png

screen2.png


Changelog


Code:
v0.1.3a
 * Added the ability to disable/enable rendering of different types of objects;
 * Added support of Indicators;
 * Added support of Occlusion Masks;
 * Added support of Lightnings;
 * Added support of Floating Text;
 * Added the ability to select the intensity units of point light sources;
 * Added Fog Of War settings;
 * Added the ability to disable standard shadows of buildings;
 * INIReader: added the ability to write comment in the same line with value of string type;
 * INIReader: added option to hide game UI;
 * Deleted Free Camera movement limits;
 * Tonemapper: Blue Correction, Expand Gamut;
 * Changed Bloom intensity to more correct;
 * Added Calibration Constant parameter for Auto Exposure;
 * Added new Exponential Height Fog;
 * Leaving the camera position unchanged after disabling Free Camera mode;
 * Improved Screen Space Reflections;
 * Default Projection Matrix renamed to Constant Vertical FoV;
 * Optimized Auto Exposure;
 * Added option to pause the game;
 * Improved input blocking in Free Camera mode;
 * Added the ability to take a screenshot;
 * Changed shading model (may be changed back in the next version);
 * Fixed a bug where one of the terrain chunks didn't cast shadows;
 * Fixed incorrect color and intensity of point and directional light sources;
 * Fixed skybox shading;
 * Fixed incorrect interception of camera parameters with non-standard near clipping plane;
 * Fixed incorrect work of contact shadows with non-standard camera clipping planes;
 * Fixed the effect of Unfogged Materials parameter;
 * Fixed post-effects rendering in main menu;
 * Fixed the influence of UI and camera direction on Contact Shadows;
 * Fixed the appearance of black borders when disabling User Interface parameter, if they were initially hidden;
 * Fixed work of Screen Space Reflections with Temporal AA;
 * Fixed graphical artifacts when turning on and off HDR;
 * Fixed projection matrix;
 * Fixed incorrect SSAO blurring with downsampling;
 * Fixed crashes while switching V-Sync mode;
 * Fixed reloading of shaders and settings while loading protected maps;
 * Fixed shadows rendering in main menu;
 * Fixed references leaking;
 * Fixed crashes then changing resolution;
 * Fixed crashes then playing movies;
 * Fixed resource loading from RenderEdge_exp.mpq;
 * Fixed incorrect texture paths in RenderEdge.ini.

v0.1.2a
 * Added the ability to select the temperature of the directional light source;
 * Added processing of standard shadow of units on the water;
 * Added the ability to select the intensity units of point light sources;
 * Added the ability to use an improved projection matrix;
 * Added the ability to load textures and shaders from the folder with RenderEdge (AllowLocalFiles in the registry);
 * Added the ability to load shaders from the map;
 * Added the option to fix the jitter of the skybox when moving the camera;
 * Reading settings from RenderEdge.ini (searching file in the map, in the folder with RenderEdge (with AllowLocalFiles enabled), in .mpq archives);
 * Now "Disable Unit Shadows" option disables the shadows of units both on the ground and on the water;
 * Reduced consumption of RAM when using shadows;
 * Removed limit of objects that can cast shadows at the same time;
 * Improved shadows quality;
 * Improved settings interface;
 * Improved free camera mode: true first person camera, independence of landscape height;
 * Soft shadows are turned off (you can turn them on by editing ShadowCommon.fxh);
 * Now shadows are not rendered if the game is paused;
 * Added the version of RenderEdge in the bottom right corner of main menu;
 * Optimization of Debug Screen;
 * Fixed a bug: the base of the building had the lighting of units instead of the terrain, and cast the shadows;
 * Fixed an incorrect intensity of point light sources;
 * The game no longer crashes when using shadows;
 * Fixed periodic disappearance of shadows when moving and rotating the camera;
 * The shadows of the landscape work again.

v0.1.1a
  * Added Contact Shadows (Screen Space Ray-Traced Shadows);
  * Added support of weather effects;
  * Added a fog for skybox;
  * Improved Color Grading: added a separate setting for Shadows, Midtones and Highlights;
  * Added the ability to manually set the gamma of the monitor: Output Device - Explicit gamma mapping (LDR);
  * Added the ability to choose the size of shadow map texture;
  * Added advanced settings for Ambient Occlusion;
  * Added the ability to hide the interface, turn off the Fog of War and standard units shadows in the Default Renderer mode;
  * Improved Debug Screen mode: full screen display;
  * Optimization of Auto Exposure;
  * Optimization of Rendering Pipeline;
  * Added descriptions of exe and dll files;
  * Fixed a bug: building models are not processed when choosing a construction site;
  * Fixed incorrect work of Auto Exposure with limited size of viewport;
  * Fixed incorrect work of SSR with Temporal AA enabled;
  * Fixed the incorrect work of post-effects for non-standard settings of the clipping planes of the camera;
  * Fixed the influence of Free Camera mode on portrait display;
  * Fixed incorrect blurring of SSAO with downsampling enabled;
  * Fixed bugs in JassAPI (conversion real <=> float);
  * Fixed camera shift when the free camera mode is turned on;
  * Fixed height of the landscape influence on the height of the free camera.

v0.1.0a
  * Added support of animated textures;
  * Added support of semi-transparent models;
  * Added support of Unshaded materials;
  * Added support of Vertex Color;
  * Added support of skybox lighting;
  * Added support of textures, the size of which is not a pow of 2;
  * Improved hiding interface;
  * Improved Sky Light: added Blend Factor parameter;
  * Improved Debug Point Light: added the ability to manually set the coordinates;
  * Improved Image Based Lighting;
  * Using pixel reflections;
  * Added the Culling Mode option for shadows;
  * Added the ability to select the format and color space of the monitor;
  * Added Temporal Anti-Aliasing;
  * Added Screen Space Reflections;
  * Added Auto Exposure (UE4);
  * Improved Chromatic Aberration;
  * Updated SSAO: replaced by Scalable Ambient Obscurance;
  * Improved Bloom (increased maximum radius, added the ability to stretch horizontally or vertically);
  * Preserving the proportions of Lens Dirt textures at any aspect ratio of the screen;
  * Anti-aliasing is now applied before other post-effects;
  * Optimization of Color Grading (LUT texture baking);
  * Displaying post-effects only inside the viewport;
  * Removed the ability to use Irradiance texture as a source of ambient lighting;
  * Removed improved water;
  * Loading and creating of textures and effects only as needed;
  * Updated d3d8 to d3d9 converter;
  * Fixed a bug when the same directional light source was used for units and terrain;
  * Fixed crashes when cutting trees with enabled shadows;
  * Fixed crashes when minimizing the game with enabled shadows;
  * Fixed crashes when the free camera mode was turned on;
  * Fixed crashes when setting a small radius in the Bloom effect;
  * Fix minimizing of the game when switching vertical synchronization;
  * Fixed stretching the screen when the interface and shadows are turned on;
  * Fixed memory leak when interface and post effects turned on;
  * Fixed incorrect display of SSAO when the Free Camera mode is on;
  * Fixed the projection function of SSAO and SSR textures on the screen;
  * Fixed incorrect gamma correction of skybox when post-processing is enabled;
  * Fixed incorrect work of Dithering;
  * Fixed incorrect color of standard point light sources;
  * Prohibition of disabling the interface and enabling the free camera mode in the main game menu and during map loading;
  * Dynamic cleaning of unused memory, occupied by shadows;
  * Fixed incorrect value of the Height and Density parameters of fog;
  * Fixed loading of textures from .mpq archives;
  * Fixed incorrect brightness of point light sources.

v0.0.2a
  * New Bloom effect;
  * Added settings for Lens Dirt;
  * Added option to test emissive materials (see 'Material' tab);
  * Unshaded materials are turned off by default, you can turn them on in the 'Material' tab;
  * Fixed problems with color conversion of standard lights and fog to linear space;
  * Fixed an issue where it was not possible to change the lighting in the maps where the SetDayNightModels("", "") function was called;
  * Added a counter of memory used by the Warcraft;
  * Debug Screens now work.

v0.0.1a
  * First stable build.



References


 
Last edited:
Level 9
Joined
Nov 29, 2014
Messages
191
can u just make Warcraft III "transparent ui"
It is already implemented!
Interface Hide.png
ACES.png


BTW, there are some progress with widescreen fix! And now minimap, portrait and all buttons are movable!
Although it requires a lot of work. In particular, at this moment to take effect of UI editing you need to restart the map.

Interface Old.png
Interface New.png




Tonemapping



And there are some tone mapping techniques (ACES Filmic now used by default):
It only remained to improve the bloom.

None.png
ACES.png
Hejl.png
Uncharted 2.png



Other new features


  • Standard fog changed to advanced Pixel Fog;
  • Added support of various fog techniques: Linear, Exponential, Exponential Square, Height Based;
  • Added physically based specular lighting;
  • Improved point light (per-pixel lighting);
  • Added support of unshaded and unfogged materials;
  • Lighting calculation in linear space;
  • The way of interception of information about the current geometry has been changed for further use when generating shadows (I previously wrote that this should increase the FPS, but this for some reason did not happen);
  • Added possibility to enable/disable vsync;
  • Improved quality of Chromatic Aberration and Lens Flares;
  • Added support of emissive materials (and now it's possible to set any value of emission power);
  • Added fake GI ambient lighting;
  • Improved SSAO;
  • Added SMAA, Film Grain, LUT Color Correction.
 
Last edited:
Level 14
Joined
Mar 11, 2017
Messages
587
Just writing to commend your effort on what seems to be a colossal undertaking.
As I know nothing of programming (let alone graphics-related software dev), I would find fascinating to know in brief how you developed this project and what kind of sklls are making it progress.
Edit: reading the past threads now.
 
Last edited:
Level 9
Joined
Nov 29, 2014
Messages
191
Okfinch, try it. I use cJass because it's more convenient for me, but you can rewrite code to vJass/Wurst.
And try last version of RenderEdge, it's more stable.
I will also post an experimental version soon, so you will be able to test improved lighting, shadows and post-effects.
 

Attachments

  • JNGP Exp2.rar
    7.2 MB · Views: 415
Last edited:
Level 1
Joined
Mar 14, 2017
Messages
5
Okfinch, try it. I use cJass because it's more convenient for me, but you can rewrite code to vJass/Wurst.
And try last version of RenderEdge, it's more stable.
I will also post an experimental version soon, so you will be able to test improved lighting, shadows and post-effects.

1.jpg
A little slow ^^ ;), i found way to let it working using "JNGP5d" that i manually added some feature like cJass in yesterday, and Yes i got your new "RenderEdge_0.2.0dev".

but i'm still didn't know how "transparent ui" working.(shawdow maping right ?, if yes but How ? what the code ?)


I read the content briefly, did't find way how "transparent ui" will working.
I'm sorry :(, i'm newbie here.
 
Level 9
Joined
Nov 29, 2014
Messages
191
i'm still didn't know how "transparent ui" working
There is no transparent UI in the current version, but if you want to test it, just download RenderEdge.dll and replace the same file in your RenderEdge directory with this one.
Then add new native function in your map: native TestInterface takes nothing returns nothing
Finally, call this function in your map initialization trigger.
In particular, at this moment to take effect of UI editing you need to restart the map.
And as I said, you should to restart the map after it initialization.
 

Attachments

  • RenderEdge.rar
    337.1 KB · Views: 299
Level 9
Joined
Nov 29, 2014
Messages
191

Release version 0.0.1a



Features:
  • Cascaded Shadow Mapping;
  • Per-pixel lighting;
  • Physically Based Shading;
  • Ambient lighting replaced by Sky Light;
  • Using Burley diffuse model instead of Lambertian;
  • All calculations when working with lighting and post-effects are carried out in a linear space;
  • ACES Tonemapping and Color Correction;
  • Image Based Lighting;
  • Normal Mapping;
  • Per-pixel fog: Linear, Exponential, Exponential Squared, Height Based;
  • Post-effects: SSAO, SMAA, Film Grain, LUT Color Correction, Auto Exposure, Bloom, Lens Flares;
  • Replaced standard water (while without reflections and refractions);
  • Free camera.
Game Fixes:
  • Skybox no longer twitches when moving the camera;
  • Removed FPS limit;
  • Added the ability to disable vertical synchronization;
  • Using of Reversed Depth Buffer technique (turned off for some reasons);
  • Ability to reduce the value of the near-plane of the camera clipping without the appearance of z-fighting artifacts.
Known Issues:
  • When cutting trees with shadows on, the game crashes;
  • Objects with the black color of the material become unshaded (until I didn't find a way to define unshaded models in another way);
  • The game can crash when the shadows are on, if there are more than 2000 objects in the frame;
  • The game can start to slow down when you turn off the shadows, if there is a large number of objects in the frame.


Installing



If you have the previous versions of RenderEdge, be sure to delete this registry key in the Registry Editor: HKEY_CURRENT_USER\Software\RenderEdge.

Requirements:



Screenshots



Physically Based Shading


Shading Standard.png

Standard Shading

Shading PBS.png

Physically Based Shading


PBS 1.png PBS 2.png PBS 3.png PBS 4.png


Image Based Lighting


Shading PBS.png

IBL Off

IBL.png

IBL On

IBL + Normals.png

IBL + Normal Mapping


Normal Mapping


Normals2 Off.png Normals Off.png

Normal Mapping Off

Normals2 On.png Normals On.png

Normal Mapping On

LUT On.png

LUT Color Correction
 

Attachments

  • RenderEdge_exp.rar
    6.7 MB · Views: 445
Last edited:
Holy shit, these new screens look almost like Starcraft 2. What about all these features though? Are they toggle-able?

For example, would I be able to turn off specular mapping, as many of the default wc3 art assets would look like metal without proper specular maps?


What about ease-of-use for players who want to apply this to maps they didn't make themselves? Is it possible for render edge to disable the regular shadow map and image-based shadows as soon as you enable the realtime rendering?
 
Level 9
Joined
Nov 29, 2014
Messages
191
Yes, all these features are configurable, however, at the moment only for all objects at once, without individual configuration. This will be implemented only after I can find a place in game.dll where are objects/models structures are located, and understand how to write and read from it. After that, I plane to modify mdx/mdl files to add new flags, such as "cast shadows", new settings for materials (metallic, roughness) and support of normal, metallic and roughness textures.
war3 2017-06-08 20-39-47-15.png
You can also download this version and check everything yourself.

BTW, here is a comparison of lighting, gamma correction and tonemapping between RenderEdge and Unreal Engine 4:

war3 2017-05-27 17-50-12-05.png war3 2017-05-27 17-50-16-34.png

RenderEdge

Снимок2.PNG Снимок.PNG

Unreal Engine 4
 
Last edited:
Level 9
Joined
Nov 29, 2014
Messages
191
I implemented a new Bloom effect from the Unity 5.6:
war3 2017-06-13 19-32-59-25.png war3 2017-06-13 19-34-53-36.png
Tomorrow I'll post an update.

Initially, I wanted to take an implementation from Unreal Engine 4, but bloom from the Unity maybe even better:

Снимок.PNG

Unreal Engine 4
 
Last edited:
Level 9
Joined
Nov 29, 2014
Messages
191

Update 0.0.2a


  • New Bloom effect;
  • Added settings for Lens Dirt;
  • Added option to test emissive materials (see 'Material' tab);
  • Unshaded materials are turned off by default, you can turn them on in the 'Material' tab;
  • Fixed problems with color conversion of standard lights and fog to linear space;
  • Fixed an issue where it was not possible to change the lighting in the maps where the SetDayNightModels("", "") function was called;
  • Added a counter of memory used by the Warcraft;
  • Debug Screens now work.
war3 2017-06-14 17-22-45-20.png war3 2017-06-14 17-22-57-82.png war3 2017-06-14 17-23-13-01.png war3 2017-06-14 17-23-23-63.png

 
Last edited:
  • Like
Reactions: pyf
Level 12
Joined
Mar 13, 2012
Messages
1,121
Looks really good. I got two questions:

1. Will this be usable with Sharpcraft WEX?
2. Can you open source it so we can look at the code?
 
Level 9
Joined
Nov 29, 2014
Messages
191
Ezekiel12, thank you.
The code will be available after transferring all current features from the experimental version to the basic version, but probably earlier.
I think it's possible to use RenderEdge with Sharpcraft WEX, but I have not yet figured out how to add custom plugins to it.
 
Last edited:
Level 9
Joined
Nov 29, 2014
Messages
191
Talavaj,
all these features are configurable, however, at the moment only for all objects at once, without individual configuration. This will be implemented only after I can find a place in game.dll where are objects/models structures are located, and understand how to write and read from it. After that, I plane to modify mdx/mdl files to add new flags, such as "cast shadows", new settings for materials (metallic, roughness) and support of normal, metallic and roughness textures.
I already tried to find it, but I could not do it. So I need help from people who are versed in the reverse engineering of dlls.
 
Level 17
Joined
Jan 18, 2010
Messages
1,122
How are the normals made in the preview pictures?
Honestly roughness/metalness don't really need a texture, most things could probably get away with simply having a global value you could maybe assign per material or geoset or something.
And the normals could really just use the diffuse map light information like a bumpmap, far better than nothing since for many surfaces the low points are usually darker anyway.

Alternatively, you could use the alpha channel of the texture to store bumpmaps or roughness for example.
Use a material with no transparency but read the alpha channel for either height or glossiness information instead.
No additional textures required to be injected or anything.

Also the fog is doope.
 
Last edited:
Level 6
Joined
Oct 25, 2010
Messages
203
if I want to use this, can I add it to a map I am making and share it with people and they will be able to see all these improvements?? or will other players need to download this in order for the map to work for them?? also does this work on the current version 1.28.4 or just 1.26a?

thanks
 
Level 17
Joined
Jan 18, 2010
Messages
1,122
The clay render looks great.
Though in the texture view, I would say the shadows ought to be a little darker or the directional light a little brighter.

How well does it run though?
I assume all the lighting data is calculated in real time and not stored in light maps or anything.
That would be expensive even in a proper engine.
 
Level 9
Joined
Nov 29, 2014
Messages
191
Severed, hi, RenderEdge still work only on 1.26a path, and every user should launch game by RenderEdge.exe to see improvements.

Talavaj, I just used different values of diffuse and ambient color of light source on screen with textures and forget to change it back when took second screenshot without textures.
Yes, I use fully dynamic shadows without baking in lightmaps. But there are some problems: I don't have direct access to objects on game scene, so I should hook they by myself. For each object in frame I create vertex and index buffer, but it not correct: I should use only one vertex buffer and one index buffer for all objects. All these buffers take up a lot of space in memory, so the game crashes when a certain limit is reached (for me it's 2000 mb). Therefore, I need the help of people who understand the reverse engineering of dynamic libraries. I need only to find in the game.dll the structure of the game object, this solve all the current problems.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
As far as memory goes, it doesn't matter if you have one buffer or a hundred, as long as they consume the same memory together.
Binding buffers, however, is relatively expensive.
I am not sure how your code works, but you might want to look into instanced rendering.
Even without instanced rendering - let's say you have a unit 20 times, you don't need its buffers 20 times - only the dynamic data needs to change.
 
Level 5
Joined
Jul 17, 2013
Messages
126
@ENAleksey are you still working on this? I have checked your tool and I am most impressed with the real time shadows, it makes the game look WAY better.
 
Level 9
Joined
Nov 29, 2014
Messages
191

Update 0.1.0a


New
  • Added support of animated textures;
  • Added support of semi-transparent models;
  • Added support of Unshaded materials;
  • Added support of Vertex Color;
  • Added support of skybox lighting;
  • Added support of textures, the size of which is not a pow of 2;
  • Improved hiding interface;
  • Improved Sky Light: added Blend Factor parameter;
  • Improved Debug Point Light: added the ability to manually set the coordinates;
  • Improved Image Based Lighting;
  • Using pixel reflections;
  • Added the Culling Mode option for shadows;
  • Added the ability to select the format and color space of the monitor;
  • Added Temporal Anti-Aliasing;
  • Added Screen Space Reflections;
  • Added Auto Exposure (UE4);
  • Improved Chromatic Aberration;
  • Updated SSAO: replaced by Scalable Ambient Obscurance;
  • Improved Bloom (increased maximum radius, added the ability to stretch horizontally or vertically);
  • Preserving the proportions of Lens Dirt textures at any aspect ratio of the screen;
  • Anti-aliasing is now applied before other post-effects;
  • Optimization of Color Grading (LUT texture baking);
  • Displaying post-effects only inside the viewport;
  • Removed the ability to use Irradiance texture as a source of ambient lighting;
  • Removed improved water;
  • Loading and creating of textures and effects only as needed;
  • Updated d3d8 to d3d9 converter.

Fixes
  • Fixed a bug when the same directional light source was used for units and terrain;
  • Fixed crashes when cutting trees with enabled shadows;
  • Fixed crashes when minimizing the game with enabled shadows;
  • Fixed crashes when the free camera mode was turned on;
  • Fixed crashes when setting a small radius in the Bloom effect;
  • Fix minimizing of the game when switching vertical synchronization;
  • Fixed stretching the screen when the interface and shadows are turned on;
  • Fixed memory leak when interface and post effects turned on;
  • Fixed incorrect display of SSAO when the Free Camera mode is on;
  • Fixed the projection function of SSAO and SSR textures on the screen;
  • Fixed incorrect gamma correction of skybox when post-processing is enabled;
  • Fixed incorrect work of Dithering;
  • Fixed incorrect color of standard point light sources;
  • Prohibition of disabling the interface and enabling the free camera mode in the main game menu and during map loading;
  • Dynamic cleaning of unused memory, occupied by shadows;
  • Fixed incorrect value of the Height and Density parameters of fog;
  • Fixed loading of textures from .mpq archives;
  • Fixed incorrect brightness of point light sources.

Bugs
  • Game crashes when switching vertical synchronization in the main menu in the windowed mode;
  • Some post-effects work incorrectly with a limited size of viewport.


Screen Space Reflections


The implementation is not perfect, there are many graphic artifacts. Some of them can be fixed, but others appear in their place. Does not work when Temporal AA is on.

ssr11.png ssr12.png

ssr21.png ssr22.png ssr23.png
ssr31.png ssr32.png ssr33.png

SSR Disabled | Depth Threshold = 100 | Depth Threshold = 3
ssr41.png ssr42.png


Temporal Anti-Aliasing


This kind of smoothing is especially useful for preventing Specular Aliasing. Implementation is also not ideal, more or less correctly works only when the camera and objects do not move:


smaa.png taa.png

SMAA | Temporal AA


Scalable Ambient Obscurance


Improved version of Screen Space Ambient Occlusion. When the camera/objects move, the ghosting effect appears, I'll fix it later.


ao21.png ao22.png ao23.png
ao11.png ao12.png ao13.png

Radius = 0 | Radius = 1 | Radius = 2


Bloom & Lens Dirt


Increased the maximum blur radius, added the ability to blur more horizontally or vertically. Lens Dirt texture now retains proportions for different screen aspect ratios. Fixed significant bugs leading to crashes.

bloom11.png bloom12.png
bloom21.png bloom22.png


Color Grading


Now color and gamma correction are done on a small texture of 32x1024, then the information from the resulting texture is applied to the final buffer. This allows to significantly improve performance (on my laptop it has grown by 20 fps), the loss of quality is noticeable only at very high brightness.
Also, it became possible to select the format and color space of the monitor (while without the support of HDR monitors).


Demo


Comparison of standard and improved lighting (without Physically Based Shading and Post-Processing):


demo11.png demo12.png
demo21.png demo22.png

Default Renderer | RenderEdge

Demonstration of lighting and post-effects on the example of my old map:

demo31.png demo32.png demo33.png
 
Last edited:
Level 9
Joined
Nov 29, 2014
Messages
191

Update 0.1.1a


Improvements
  • Added Contact Shadows (Screen Space Ray-Traced Shadows);
  • Added support of weather effects;
  • Added a fog for skybox;
  • Improved Color Grading: added a separate setting for Shadows, Midtones and Highlights;
  • Added the ability to manually set the gamma of the monitor: Output Device - Explicit gamma mapping (LDR);
  • Added the ability to choose the size of shadow map texture;
  • Added advanced settings for Ambient Occlusion;
  • Added the ability to hide the interface, turn off the Fog of War and standard units shadows in the Default Renderer mode;
  • Improved Debug Screen mode: full screen display;
  • Optimization of Auto Exposure;
  • Optimization of Rendering Pipeline;
  • Added descriptions of exe and dll files.

Fixes
  • Fixed a bug: building models are not processed when choosing a construction site;
  • Fixed incorrect work of Auto Exposure with limited size of viewport;
  • Fixed incorrect work of SSR with Temporal AA enabled;
  • Fixed the incorrect work of post-effects for non-standard settings of the clipping planes of the camera;
  • Fixed the influence of Free Camera mode on portrait display;
  • Fixed incorrect blurring of SSAO with downsampling enabled;
  • Fixed bugs in JassAPI (conversion real <=> float);
  • Fixed camera shift when the free camera mode is turned on;
  • Fixed height of the landscape influence on the height of the free camera.


Contact Shadows


Contact shadows are calculated in the screen space and allow you to get clear shadows even from the smallest objects. Performance does not depend on the complexity of the scene. But at the moment there is a serious problem - the direction in which objects cast shadows, depends on the direction of view of the camera.


cs11.png cs.png

Off | On

cs11.png cs12.png cs13.png

Shadows Off | Cascaded Shadows | Cascaded + Contact Shadows

cs21.png cs22.png cs23.png

Cascaded Shadows | Cascaded + Contact Shadows | Shadows + Ambient Occlusion


Color Grading


Now Color Grading and Tone Mapping are completely similar to the corresponding effects from Unreal Engine 4:
Color Grading and Filmic Tonemapper
 
Level 3
Joined
Jan 12, 2014
Messages
67
the only reason i haven't gotten into the wc3 modeling scene is because i strongly prefer using blender, so this is pretty awesome to me, but will there be animation support for blender? if that's out-of-scope that's fine, just wondering

really cool project, i'll try it ASAP
 
Level 2
Joined
May 24, 2018
Messages
8
I can't open it. It say's...

"Windows does not have access to the specified device, path, or file. You may not have the appropriate permissions to access the item."

Solution?...
 
Level 9
Joined
Nov 29, 2014
Messages
191

Update 0.1.2a


Improvements
  • Added the ability to select the temperature of the directional light source;
  • Added processing of standard shadow of units on the water;
  • Added the ability to select the intensity units of point light sources;
  • Added the ability to use an improved projection matrix;
  • Added the ability to load textures and shaders from the folder with RenderEdge (AllowLocalFiles in the registry);
  • Added the ability to load shaders from the map;
  • Added the option to fix the jitter of the skybox when moving the camera;
  • Reading settings from RenderEdge.ini (searching file in the map, in the folder with RenderEdge (with AllowLocalFiles enabled), in .mpq archives);
  • Now "Disable Unit Shadows" option disables the shadows of units both on the ground and on the water;
  • Reduced consumption of RAM when using shadows;
  • Removed limit of objects that can cast shadows at the same time;
  • Improved shadows quality;
  • Improved settings interface;
  • Improved free camera mode: true first person camera, independence of landscape height;
  • Soft shadows are turned off (you can turn them on by editing ShadowCommon.fxh);
  • Now shadows are not rendered if the game is paused;
  • Added the version of RenderEdge in the bottom right corner of main menu;
  • Optimization of Debug Screen.

Fixes
  • Fixed a bug: the base of the building had the lighting of units instead of the terrain, and cast the shadows;
  • Fixed an incorrect intensity of point light sources;
  • The game no longer crashes when using shadows;
  • Fixed periodic disappearance of shadows when moving and rotating the camera;
  • The shadows of the landscape work again.


Cascaded Shadows


Fixed a lot of problems with shadows: now they don't use huge amount of RAM and don't cause game crashes; removed the limit on 2048 objects, which can cast shadows at the same time; fixed a bug with the periodic disappearance of some shadows when moving the camera.

In this screenshot there are about 5500 objects in frame at the same time. Without shadows, the game uses 170 MB of RAM, with shadows - 210 MB (in previous versions, the game would have used more than 2000 MB and crashed):
WC3ScrnShot_050618_171949_01.png


Reading settings from file


Added the ability to read the settings from the RenderEdge.ini file, it is in the RenderEdge_exp.mpq archive. You can also import it into your map.
Don't write comments in one line with fields where logical variables and paths to textures are specified, since information about them will not be obtained correctly!


Using custom shaders and textures


Now it's possible to edit standard shaders. They must be compiled, have a .cso extension, and be in the Shaders folder.

You can enable the option to load settings file, 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_exp.mpq archive.

Compiling shaders in Visual Studio:

Add the shaders to the project and configure the HLSL Compiler in the project properties as follows:


Compiling shaders 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


Free Camera mode


Now it is true first person: when it moves, the coordinates of camera's eye change, not its targets, and the height of the terrain no longer affects the height of the camera.
Later, I will add native functions for editing coordinates of the eye and the target of the camera.


Settings interface


By default, the interface is hidden, and is displayed when the F7 key is pressed. The initial state and hotkey can be changed in RenderEdge.ini:
Code:
[Engine]
bShowInterface = false

[Hotkeys]
ShowInterface = 0x76
 
Last edited:
  • Like
Reactions: pyf
Status
Not open for further replies.
Top