OSP Other Skyboxes Lighting Tutorial and Assets

Users who are viewing this thread

Skyboxes / Lighting Tutorial and OSP
ZMHO7uU.gif

wyPWxJy.jpg



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


ykhcY6K.jpg




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






 
ZMHO7uU.gif

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:
 
_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.
 
ShaunRemo said:
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.
 
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.
 
ShaunRemo said:
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 :wink:
 
_Sebastian_ said:
ShaunRemo said:
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 :wink:
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:
t6475k.jpg
qssac7.jpg
359dz81.jpg
10zs013.jpg
 
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.
 
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.
Did you try this?
 
Back
Top Bottom