Author Topic: [OSP]Skyboxes Lighting Tutorial and Assets  (Read 9239 times)

0 Members and 1 Guest are viewing this topic.

ShaunRemo

  • Knight
  • *
    • View Profile
  • Faction: Neutral
[OSP]Skyboxes Lighting Tutorial and Assets
« on: November 12, 2015, 05:43:14 AM »
Skyboxes / Lighting Tutorial and OSP




This OSP features 27 skyboxes with custom lighting compared to Natives 7
The idea of this mod is to provide a much more diversity in lighting for each skybox and weather condition.
Darker more moonlight nights, Brighter days, colourful sunsets and luminous dark storms.
Hopefully mostly this will reduce the need for additional injectors as tweaking the visuals will be easier.

PLEASE NOTE

This is not entirely finished and will need polishing and tweaking to become better.
The terrain border for most of these shots is actually a duplicate world map mesh with testing infinite shader and does not come with the mod (yet)




What you see is what you get

I have figured out the calculation for all of the relevant Skyboxes.py input numbers so they reflect what you see in-game so you can edit the lighting conditions and copy them into Skyboxes.py for easy edits.

First thing to do is replace postfx.txt with the new version, this uniforms all the values to match the input into skyboxes.py






HDR and why its not working
It is recommended that you break down a HDR sky image to create the base, RGB and EXP texture file. Taleworlds provided a program that converted HDR to the correct formats however I can't find a working one.
The breakdown also provided correct (specular.red = Scale component, specular.green = Bias component) which drastically alters the look of HDR, so currently they are all set to 0.
The EXP texture file which would be created from the program is in an odd format and I haven't successfully converted to it.

Therefore HDR is working but doesn't look very good.



BRF:

Textures:

All textures have the sun or moon moved to the center of the texture horizontally, this surpasses the need for Sun Heading in Skyboxes.py and stops the Tatooine error.
All textures should be gamma corrected and no mipmaps.
Base: Flags 11   Format: DXT 1
EXP:   Flags 25   Format: DXT 1
RGB:   Flags 25   Format: L16 half resolution (I can't get it to be L16)

Most of the textures were sourced from this mod.
http://www.nexusmods.com/mbwarband/mods/2100/?
Therefore
"One or more textures on this 3D model have been created with images from CGTextures.com. These images may not be redistributed by default, please visit www.cgtextures.com for more information."

Material:

Shader:
ALL materials with the sun use    skybox_shader_new
ALL materials with the moon use skybox_shader

Night skyboxes don't have HDR

DiffuseA:  base texture
DiffuseB:  RGB texture
Bump:      none
Enviro:     EXP texture
Specular: none

Spec:
R:       Scale component
G:       Bias component
B:       0
Coeff: 1

Mesh
Flags: 0
The mesh is a version I altered myself, is has fewer polygons than native and almost entirely removes the artefacts at the very top of the mesh by stretching the UV therefore blending the texture.
You will also find here sun angle helpers, this is so you can measure the altitude of any new material's sun easily.



Weather Settings:
This is a list of the in-game weather settings and where they are kept in the module.
SB = skyboxes.py   PFX = postfx.py  NA = Unknown  E = Can be edited in game and numbers correspond over.

Ambient - SB Preview/Editable
Fog - SB Preview/Editable
Ground Ambient - NA
PFX-1 - PFX
R         - HDRRange, 
G         - HDRExposureScaler,
B         - LuminanceAverageScaler,
A         - LuminanceMaxScaler
PFX-2 - PFX
R         - BrightpassTreshold,
G         - BrightpassPostPower,
B         - BlurStrenght,
A         - BlurAmount,
PFX-3 - PFX
R         - AmbientColorCoef, Preview/Editable
G         - SunColorCoef, Preview/Editable
B         - SpecularCoef, Preview/Editable
A         - reserved,
PostFX - NA
SkyDir - NA
SkyLight - NA
SunDir - SB Editable
SunLight - SB Preview/Editable



Additional info

Reflective map water- The first step is either use the new postfx.txt or manually edit it from map_params 0 3 to map_params 0 0 this allows the shader to work.
Then you need to edit materials.brf change the shader of map_ocean and map_river to water_shader save and enjoy!

There is noticeable join of the water plains near the shore and the map foam doesn't move but these hopefully can be resolved later.

Day Cycle- The skyboxes actually rotate! but it's a bit hard to tell without reference. The skyboxes will adjust every hour, it rotates clockwise and starts in the North at 0 East at 6 (sunrise) South at 12 West at 18 (sunset) and returns to North at 0.
This means with a bit of module coding we could decent overall day cycle.

Rain/Snow Rain and snow appear only when the Global_Cloud amount is at 100.

More specific information can be found in Skyboxes.py and PostFX.py








« Last Edit: July 11, 2018, 07:17:43 PM by Duh »

Ruthven

  • Revs lil' helper
  • Baron
  • *
  • crushie crushie crushie
    • View Profile
  • Faction: Neutral
  • MP nick: irc://Ruthven
  • WBM&BVC
Re: Skyboxes Lighting Tutorial and OSP
« Reply #1 on: November 12, 2015, 07:31:15 AM »
 :shock:

I don't even know what to say. This is fantastic!


ShaunRemo

  • Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Skyboxes Lighting Tutorial and OSP
« Reply #2 on: November 12, 2015, 07:52:57 AM »
Thanks Ruthven  I would also love to see anyone's screenshots or tweaks they make!

_Sebastian_

  • Punkbuster 2.0
  • Baron
  • *
  • Lazy Wizard
    • Steam - themostlazy
    • YouTube - UCfHPlDpBaLtqFjy_gMJFtCg
    • View Profile
    • Bad Bug Busters Discord
  • Faction: Bandit
  • MP nick: _Sebastian_
  • NWWBVC
Re: Skyboxes Lighting Tutorial and OSP
« Reply #3 on: November 12, 2015, 11:47:44 AM »

How the heck did you manage to change the sun heading?
I'm not talking about the skybox itself, but the actual sun light position.

It's allways south, doesn't matter which parameters you change...
...so tell me your black magic  :wink:

ShaunRemo

  • Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Skyboxes Lighting Tutorial and OSP
« Reply #4 on: November 12, 2015, 11:54:17 AM »
_Sebastian_ under additional information you'll see day cycle, this section explains this and is actually just a part of native, but appeared random due to the un-uniform nature of the default skyboxes. The alttitude of the sun is set within skyboxes.py.

Hope that helps.

_Sebastian_

  • Punkbuster 2.0
  • Baron
  • *
  • Lazy Wizard
    • Steam - themostlazy
    • YouTube - UCfHPlDpBaLtqFjy_gMJFtCg
    • View Profile
    • Bad Bug Busters Discord
  • Faction: Bandit
  • MP nick: _Sebastian_
  • NWWBVC
Re: Skyboxes Lighting Tutorial and OSP
« Reply #5 on: November 12, 2015, 12:24:05 PM »
The alttitude of the sun is set within skyboxes.py.
I talked about the heading, not altitude.
If you change the heading parameter it just results in a rotated skybox, but the horizontal sun light position remains the same... its allways south.

ShaunRemo

  • Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Skyboxes Lighting Tutorial and OSP
« Reply #6 on: November 12, 2015, 12:44:09 PM »
Yep, so if you read the day cycle part of my first post you can see that the skyboxes and sun rotate during the day.

I haven't experimented if this is possible outside of the campaign or not but presumably setting the time of day 0-24 then choosing a skybox should work.

If the skybox is always south the presumably the time of day is set to 12, If you want a North West Skybox setting the time to 21 then choosing a skybox should work.

I will add a diagram to that section also and post feedback if it works.

_Sebastian_

  • Punkbuster 2.0
  • Baron
  • *
  • Lazy Wizard
    • Steam - themostlazy
    • YouTube - UCfHPlDpBaLtqFjy_gMJFtCg
    • View Profile
    • Bad Bug Busters Discord
  • Faction: Bandit
  • MP nick: _Sebastian_
  • NWWBVC
Re: Skyboxes Lighting Tutorial and OSP
« Reply #7 on: November 12, 2015, 02:12:18 PM »
I haven't experimented if this is possible outside of the campaign or not but presumably setting the time of day 0-24 then choosing a skybox should work.
Thats exactly how I do it, but it just rotates the sky box.
I'm only working on the Multiplayer part of the game, so that might be the issue.

Anyway, it's bugged for sure ;)

Caba`drin

  • Dovie'andi se tovya sagain
  • Forum Legend
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • WBM&BWF&SNWVC
Re: Skyboxes Lighting Tutorial and OSP
« Reply #8 on: November 12, 2015, 05:41:52 PM »
Quite impressive. Cheers.



Ruthven

  • Revs lil' helper
  • Baron
  • *
  • crushie crushie crushie
    • View Profile
  • Faction: Neutral
  • MP nick: irc://Ruthven
  • WBM&BVC
Re: Skyboxes Lighting Tutorial and OSP
« Reply #9 on: November 12, 2015, 09:34:28 PM »
I haven't experimented if this is possible outside of the campaign or not but presumably setting the time of day 0-24 then choosing a skybox should work.
Thats exactly how I do it, but it just rotates the sky box.
I'm only working on the Multiplayer part of the game, so that might be the issue.

Anyway, it's bugged for sure ;)
Are you using HDR? That might make a difference.

Anyways I got this into the game and was really impressed with the effect it has. No more disgusting dawn light, now every time of day looks excellent. Can't wait until I get some cloudy days in-game. I do think it needs some tweaking but even as-is it's a huge improvement. Some screenshots for those interested:
(click to show/hide)
(click to show/hide)
(click to show/hide)
(click to show/hide)


ShaunRemo

  • Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Skyboxes Lighting Tutorial and OSP
« Reply #10 on: November 12, 2015, 11:53:35 PM »
I haven't tested anything yet (can't get python working after windows 10 update)


_Sebastian_ are you using ti_before_mission_start: to change the time of day and skybox? The lighting is calculated before the mission starts and can't be altered (as far as I'm aware) so you might be altering the time of day, the skybox rotates but the lighting has already been set therefore doesn't update.

Awesome Ruthven if there is anything specific give us a shout, I need feedback I've already changed a few settings that I didn't notice were to bright/dark etc. It's a bit hard however when there are 27 skyboxes to keep track of.
« Last Edit: November 13, 2015, 12:02:16 AM by ShaunRemo »

_Sebastian_

  • Punkbuster 2.0
  • Baron
  • *
  • Lazy Wizard
    • Steam - themostlazy
    • YouTube - UCfHPlDpBaLtqFjy_gMJFtCg
    • View Profile
    • Bad Bug Busters Discord
  • Faction: Bandit
  • MP nick: _Sebastian_
  • NWWBVC
Re: Skyboxes Lighting Tutorial and OSP
« Reply #11 on: November 13, 2015, 12:49:00 PM »
are you using ti_before_mission_start: to change the time of day and skybox?
Sure, those operations only work on ti_before_mission_start.

Froi

  • Infidel
  • Knight at Arms
  • *
    • Steam - Rowan12312345
    • View Profile
  • Faction: Swadian
  • MP nick: Froi
  • WBNWM&BWF&SVC
Re: Skyboxes Lighting Tutorial and OSP
« Reply #12 on: November 13, 2015, 01:07:03 PM »
Fantastic work!
Froi would know.  He hides naked in the bushes watching everyone fight.
Froi is love, Froi is life.
Froi are you the dead hooker on steam?

ElPadrino

  • Sergeant Knight at Arms
  • *
  • Cartoon & 2D Art
    • YouTube - ElPadrino Moddeur
    • View Profile
  • Faction: Neutral
Re: Skyboxes Lighting Tutorial and OSP
« Reply #13 on: December 29, 2015, 09:42:28 PM »
Wow ! Just discovered that. Great job !

CutContent

  • Knight
  • *
  • Ecclesiastes 2:17
    • Steam - http://steamcommunity.com/id/asx234azx
    • View Profile
  • Faction: Neutral
  • M&B
Re: Skyboxes Lighting Tutorial and OSP
« Reply #14 on: December 31, 2015, 06:02:45 PM »
Looks spectacular  :wink: