Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terrain shader experiments #3585

Closed

Conversation

@Garanas
Copy link
Member Author

Garanas commented Dec 4, 2021

Adjusted blending

image
new blending where we use the alpha as a blend mask

image
old blending being basic linear interpolation

There are still some artifacts - but regardless the blending is a lot more impressive now. You can control the blending with the alpha layer of the albedo texture.

@Garanas Garanas added this to the Dev 3727 milestone Dec 4, 2021
@Garanas
Copy link
Member Author

Garanas commented Dec 10, 2021

image
image
image
image

Some intermediate results - this is an initial draft. Nothing is final yet. Overview of the current texture usage:

|  | Albedo stratum                                              | Normal stratum
|L | R           | G             | B             | A             | R             | G             | B             | A                 |
----            ---             ---             ---             ---             ---             ---             ---                 ---
|0 | R             G               B               Height        | X               Y               Occlusion       Roughness
|1 | R             G               B               Height        | X               Y               Occlusion       Roughness
|2 | R             G               B               Height        | X               Y               Occlusion       Roughness
|3 | R             G               B               Height        | X               Y               Occlusion       Roughness
|4 | R             G               B               Height        | X               Y               Occlusion       Roughness
----            ---             ---             ---             ---             ---             ---             ---                 ---
|5 | R             G               B               Height        | X               Y               Occlusion       Roughness
|6 | R             G               B               Height        | X               Y               Occlusion       Roughness
|7 | Map R         Map G           Map B           Map alpha     | Map X           Map Y           Map Z           Map alpha
|8 | Map wetness   Map shadows     Map Ambient     Map metallic  | 
|9 | ?

Where only stratum layers 7 / 8 are implemented. The others still use the old lighting model.

@Garanas
Copy link
Member Author

Garanas commented Dec 13, 2021

That commit is on the wrong branch 😄

@MrRowey
Copy link
Member

MrRowey commented Dec 13, 2021

😆

@Garanas
Copy link
Member Author

Garanas commented Dec 17, 2021

image
image
image
image
image

Draft 2.0 where I introduced a second map to experiment with.

@Garanas
Copy link
Member Author

Garanas commented Dec 17, 2021

image
image
image
image
image

Similar screenshots using the old map-wide technique. Note that Auralian (the green map) cheats because it uses 8192x8192 textures, where as the version with the new shaders uses 4096x4096 textures. There was no particular reason for this except ease of work.

A few things to note:

  • Shadows are applied on top of terrain lighting computations, therefore it is a lot darker.
  • There is no (or little) ambient occlusion in this version as that just makes everything more dark.
  • There are bits that receive light but shouldn't because shadows are not part of the computations. I've highlighted one place where this happens (first green image, red box).

@Garanas
Copy link
Member Author

Garanas commented Jan 4, 2022

In order to limit the scope of this pull request the focus will be on allowing map-wide content through the stratum layers. This is what you see in the screenshots at the moment. The other effects like advanced stratum interpolation and fixing small issues (like the masks being * 2 by default) will be for another release.

I think having the possibility of shadows and global illumination-like techniques on maps will make a significant difference regardless.

--**
--** Summary : Thuntho Artillery Shell Projectile script, XSL0103
--**
--** Copyright � 2007 Gas Powered Games, Inc. All rights reserved.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like copyright unicode character for copyright got replaced by U+FFFC

@@ -6,30 +6,25 @@
-- Summary : Thuntho Artillery Shell Projectile script
-- Seraphim T1 Artillery : XSL0103
--
-- Copyright � 2007 Gas Powered Games, Inc. All rights reserved.
-- Copyright � 2007 Gas Powered Games, Inc. All rights reserved.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is going to be the same for a lot of the Lua files in the game not just these few

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea why my editor replaces this every time? I think half of the files with a question mark are my doing at this point 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so from a search it can be as simple as the VSCode encoding in the blue bar at the bottom switching between UTF-8 & Windows 1252 seems to fix the issues with the C symbol not showing if the diamond is present
image

image

@Garanas
Copy link
Member Author

Garanas commented Jan 7, 2022

Fixed the branch so that it only involves the relevant changes.

@Garanas
Copy link
Member Author

Garanas commented Jan 7, 2022

And I messed up again 😄

@Garanas
Copy link
Member Author

Garanas commented Jan 7, 2022

Not as pretty as I wanted it to be but now it is all good 😄

@Garanas
Copy link
Member Author

Garanas commented Jan 7, 2022

I tried to upload a test map directly onto Github, but to no avail. Here it is via WeTransfer:

@Garanas
Copy link
Member Author

Garanas commented Oct 3, 2022

terrain-example-01.mp4

An example of the zoom behavior for cliffs

@Garanas
Copy link
Member Author

Garanas commented Oct 9, 2022

image

image

Working with better blending patterns for normals and albedo

@Garanas
Copy link
Member Author

Garanas commented Oct 9, 2022

The repetitiveness of the ground textures is still a work in progress 😃

@Garanas Garanas removed this from the Dev 3727 milestone Nov 1, 2022
@Garanas
Copy link
Member Author

Garanas commented Apr 12, 2023

The possibilities are there, but without a fitting editor it is very difficult to work with the new shaders. The majority of suggested changes are already merged in with #4380 by accident.

@Garanas Garanas closed this Apr 12, 2023
@BlackYps BlackYps mentioned this pull request May 6, 2023
@Garanas Garanas mentioned this pull request Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants