Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 9:01 am
All times are UTC + 0
Voxel light source position calculation
Moderators: Global Moderators, OpenRA Moderators
Post new topic   Reply to topic Page 1 of 1 [7 Posts] Mark the topic unread ::  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:  Voxel light source position calculation Reply with quote  Mark this post and the followings unread

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:  9785 Time(s)

OpenRA-yaw.png




Key Words: #Tutorials #OpenRA #Voxels 

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  Mark this post and the followings unread

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
Defense Minister


Joined: 09 Feb 2015

PostPosted: Sun May 03, 2015 1:58 am    Post subject: Reply with quote  Mark this post and the followings unread

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.
Stealth Laser Trooper


Joined: 15 Jun 2012
Location: Germany

PostPosted: Sun May 03, 2015 5:51 am    Post subject: Reply with quote  Mark this post and the followings unread

You can solve that via the rule inheritance feature.

Back to top
View user's profile Send private message
NimoStar
Commander


Joined: 07 Nov 2012
Location: Buenos Aires

PostPosted: Sat Apr 30, 2016 8:32 pm    Post subject: Reply with quote  Mark this post and the followings unread

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: Iszkaszentgyorgy, Hungary

PostPosted: Sun May 01, 2016 2:37 pm    Post subject: Reply with quote  Mark this post and the followings unread

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.

_________________
"If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more...

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID
penev
Vehicle Driver


Joined: 28 Feb 2015

PostPosted: Mon May 02, 2016 1:10 pm    Post subject: Reply with quote  Mark this post and the followings unread

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] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


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


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You cannot 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

[ Time: 0.1729s ][ Queries: 14 (0.0118s) ][ Debug on ]