:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::
Do you want to advertise at Project Perfect Mod. Find out how to do it HERE.

The time now is Wed Sep 20, 2017 5:37 am
All times are UTC + 0
 Forum index » Modding Central » OpenRA Editing Forums
Tutorial: Voxel light source position calculation
Moderators: Global Moderators, OpenRA Moderators
Post new topic   Reply to topic Page 1 of 1 [7 Posts] View previous topic :: View next topic
Author Message
Reaperrr
Commander


Joined: 26 Apr 2003
Location: Somewhere in Germany

PostPosted: Sat May 02, 2015 12:53 pm    Post subject:   Tutorial: Voxel light source position calculation Reply with quote

Credit for the image below goes to tomsons26lv.

If you don't know the engine that well, this might be tricky since there aren't many examples yet, so I decided to write a short tutorial on how to calculate and set the light source on voxels in OpenRA (for voxel shading and shadow).


OpenRA treats voxels a bit like 3D-models and calculates shading and shadow based on normals and position of light source, ignoring .vpl (this may or may not change in the future).
You can set the position of the light source for each voxel individually, tomsons26lv made a good example showing how it works (attached below).
In that example LightPitch is the green curve, LightYaw is the white circle.

To recreate RA2 lighting, you would probably need approximately these settings:
Code:
RenderVoxels:
    LightPitch: 128 (or less)
    LightYaw: 768 (or 896 if you want shadows to match buildings)


OpenRA's current internal defaults are calculated from degrees (50 for Pitch and 240 for Yaw), and roughly translate to
Code:
    LightPitch: 107
    LightYaw: 683

according to my tests.


OpenRA-yaw.png
 Description:
 Filesize:  102.4 KB
 Viewed:  2862 Time(s)

OpenRA-yaw.png



Last edited by Reaperrr on Sun Sep 20, 2015 5:01 pm; edited 1 time in total

Back to top
View user's profile Send private message Send e-mail
Reaperrr
Commander


Joined: 26 Apr 2003
Location: Somewhere in Germany

PostPosted: Sat May 02, 2015 1:26 pm    Post subject: Reply with quote

Edited, seems the engine sees the vertical Pitch as 360 degree.

Back to top
View user's profile Send private message Send e-mail
G-E
General


Joined: 09 Feb 2015

PostPosted: Sun May 03, 2015 1:58 am    Post subject: Reply with quote

This perfectly explains the boring voxels in the other recent previews...

More specifically, it shows why WW chose afternoon sun to light the objects, and not noon, you have more visual depth.

But why not a global setting? Surely there's no need for multitude of different light sources in the same game/mod?
_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
Matthias M.
Jumpjet Infantry


Joined: 15 Jun 2012
Location: Germany

PostPosted: Sun May 03, 2015 5:51 am    Post subject: Reply with quote

You can solve that via the rule inheritance feature.

Back to top
View user's profile Send private message Visit poster's website
NimoStar
Pyro Sniper


Joined: 07 Nov 2012
Location: Buenos Aires

PostPosted: Sat Apr 30, 2016 8:32 pm    Post subject: Reply with quote

Nice explanation,

but am I the only one who thinks .vpl MUST be included in calculations?

At the very least, take into accunt the lightmaps of the models...

The effects are obvious of this omission. Look at the "glossy" reflecting surface of the MCV on the RA2 preview (or the RA2 game) . Now look at the plain dull lighting of OpenRA.

In TS it is the same. The light has less reflection because it uses half the number of facets, but the effect is rougly the same.

Compare here:



and here:



Both openRA previews, surely showcasing impressive unit production mechanics.
And yet, the units look plain, even if the voxel files are the same as original ones.

but now look at this:


http://sun.tiberiumweb.org/tsgallery/ingame_beta_screenshots/02.jpg

This is a BETA screenshot, but even then, you can see how the voxel units have a characteristic dynamic metal-like glow/reflection that makes their surfaces seem well, metallic.

It also enchances detail and gives the unit volume and depth, as well as showcasing the reflective differences between materials and including shadows, reflections, and lighting within the model itself, which dynamically change with each facing.

It would be a shame if OpenRA settles for graphical inferiority to the originals. This is very important to give the vehicles character and volume.
_________________

Back to top
View user's profile Send private message Visit poster's website
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyörgy, Hungary

PostPosted: Sun May 01, 2016 2:37 pm    Post subject: Reply with quote

The VPL logic is shit and advocating it is retarded. Hell, all of your bolded thoughts are something OpenRA is capable of, but the WW VPL logic isn't.

Also, you're crying for lack of glow and contrast, but the option to increase either of them is there already. Besides, since you're bad at seeing things - the light comes from behind to the voxels. Ofcourse they will seem pale to the viewport, when they are between the viewport and the source of light. Oh, look, selfshadowing!

Basically, you assume that the VPL enabled WW to glow the voxels, which is wrong. If you increase diffuse lighting to ludicrous levels and set the voxel lighting to lighten it from the viewport, you get a lot brighter result regarding the WW glow WW could ever reached.

Just keep in mind, noone else excluding you here was a fan of the WW glow.
_________________



AS Discord server: https://discord.gg/7aM7Hm2

Back to top
View user's profile Send private message MSN Messenger
penev
Vehicle Driver


Joined: 28 Feb 2015

PostPosted: Mon May 02, 2016 1:10 pm    Post subject: Reply with quote

Just a friendly reminder: that image from the TS beta that you use as an example has more Photoshop on it than a beauty magazine. Wink
Of course it looks good. But it doesn't exactly look like the game itself.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [7 Posts] View previous topic :: View next topic
 Forum index » Modding Central » OpenRA Editing Forums
Jump to:  
Quick Reply
Username:


If you are visually impaired or cannot otherwise play the game below please contact the Administrator for help.


 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

Wildcard SSL Certificates
[ Time: 3.2945s ][ Queries: 15 (2.9739s) ][ Debug on ]