Automatic Greebler & True Normal Mapping

In here you can discuss what is going on in the project, offer help, praise or critique!

Re: Automatic Greebler & True Normal Mapping

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Fri Sep 17, 2021 6:07 pm

Thanks for your comments guys.

My personal approach is to release frequently, and deal with the bugs later; rather than wait for perfection and never release at all. So, yesterday I posted an update to the ddraw beta with support for this feature. I included some sample greeble textures and materials too in case anyone else want to try this. The instuctions are in the docx file (included in the package), but I'll also post the instructions here later. The sample greeble textures were created by Vince T and JC.

Bear in mind that I'm still tinkering with this feature, so I might decide to change or add a few things later. But people are welcome to play with this now!

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Sat Sep 18, 2021 11:20 pm

WOW!, I go away for a little and come back to this - Amazing.

Trev

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon Sep 20, 2021 7:12 pm

Here are a few more shots of the asteroid. I'm using a new blending mode that I haven't published yet. Here, I'm hovering right on the surface of the asteroid:

auto-greeble-13.jpg
auto-greeble-14.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon Sep 20, 2021 7:15 pm

More shots:
auto-greeble-15.jpg
auto-greeble-16.jpg

This mode does an UV displacement of the original texture plus normal mapping, at the same time. The UV displacement introduces a distortion to the original texture that breaks pixelation at close range. Since the distortion texture uses only the r and g channels, it can be a normal map too. In that case, we can apply distortion and normal mapping at the same time. In addition to that, I'm using a grayscale texture with the Overlay blending mode to add more details at close range.
You do not have the required permissions to view the files attached to this post.

User avatar
Forceflow
Fleet Admiral (Administrator)
Posts: 7203
Joined: Wed Oct 20, 1999 11:01 pm
Contact:

Post by Forceflow » Tue Sep 21, 2021 5:23 am

:schockiert: Man this is looking incredible
Murphy was an optimist! I am a pessimist!
And always remember that a smile is cheaper than a bullet! (District 9)
Webmaster of the X-Wing Alliance Upgrade Project

marcop000
Cadet 1st Class
Posts: 213
Joined: Fri Dec 27, 2019 7:08 pm

Post by marcop000 » Tue Sep 21, 2021 6:03 am

This is a incredible improvement !! and don't drop the frame rate (frankly I don't understand how is possible). Hope to see soon the official upgrade completed.

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Tue Sep 21, 2021 5:21 pm

marcop000 wrote:
Tue Sep 21, 2021 6:03 am
This is a incredible improvement !! and don't drop the frame rate (frankly I don't understand how is possible). Hope to see soon the official upgrade completed.
I released a preview a few days ago. It doesn't support the latest blend modes, but it works and I provided some samples for people to play with.

It does lower the framerate a little bit. For each pixel that has normal mapping activated, I need to compute a coordinate system to apply the effect properly. It's just a handful of multiplications and additions, but it can add up if every surface is normal-mapped. The problem I've had when I try to measure the framerate drop is that the asteroid is so big that the game sometimes puts an ISD inside it and I can't see it (I use a skirmish mission to test this). But overall, I think we only suffer a 5-10% drop. Not too bad, I think.

marcop000
Cadet 1st Class
Posts: 213
Joined: Fri Dec 27, 2019 7:08 pm

Post by marcop000 » Tue Sep 21, 2021 6:51 pm

blue_max wrote:
Tue Sep 21, 2021 5:21 pm
marcop000 wrote:
Tue Sep 21, 2021 6:03 am
This is a incredible improvement !! and don't drop the frame rate (frankly I don't understand how is possible). Hope to see soon the official upgrade completed.
I released a preview a few days ago. It doesn't support the latest blend modes, but it works and I provided some samples for people to play with.

It does lower the framerate a little bit. For each pixel that has normal mapping activated, I need to compute a coordinate system to apply the effect properly. It's just a handful of multiplications and additions, but it can add up if every surface is normal-mapped. The problem I've had when I try to measure the framerate drop is that the asteroid is so big that the game sometimes puts an ISD inside it and I can't see it (I use a skirmish mission to test this). But overall, I think we only suffer a 5-10% drop. Not too bad, I think.

considering the huge graph improvement a 5-10% of FPS drop is zero and this feature shuld be set ON at default for my opinion.

But the most thing that frankly I don't understand is how is possible that with a Automatic process like this there isn't any type of side effect ..

Normally all automatic system can produce some error, expecially when the changes are so complex ...

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Wed Sep 22, 2021 12:06 am

marcop000 wrote:
Tue Sep 21, 2021 6:51 pm
But the most thing that frankly I don't understand is how is possible that with a Automatic process like this there isn't any type of side effect ..

Normally all automatic system can produce some error, expecially when the changes are so complex ...
Maybe I shouldn't have called this feature "Automatic Greebler": there's some degree of manual intervention that OPT creators must do to enable this feature. The OPT creator must first create a texture that can be used to add greebles or details to the OPT and the creator must also decide which areas of the OPT benefit from this feature, which blending mode works best -- and what distance.

It's "automatic" because you don't have to create actual 3D greebles. This can be a time-consuming process that will also have a heavy impact in performance. You also don't have to worry about creating multiple giant textures to ensure your OPT will look well at close distance. Just a medium-res or high-res texture plus a greeble texture and you're done. In short, if you are an OPT creator, this feature may save you some amount of work.

User avatar
Driftwood
Admiral (Moderator)
Posts: 2174
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Wed Sep 22, 2021 1:59 am

"Semi-automated.

User avatar
m0rgg
XWAU Member
Posts: 266
Joined: Wed Apr 01, 2020 10:33 pm

Post by m0rgg » Wed Sep 22, 2021 6:18 am

Maybe "generated greebles" vs "modelled"?

User avatar
DarHan
Rebel Alliance
Posts: 325
Joined: Mon Dec 05, 2005 12:01 am
Contact:

Post by DarHan » Thu Sep 23, 2021 6:14 pm

Quick feedback:

I copied the SSD’s settings to the ISD1 to apply the normal texture to the destroyer’s main surfaces (TEX00017, 18, 20, 21, 24, 25, 26, 27, 28) as a test.

It looks great, but I noticed that sometimes, if I destroy one of the turrets and the damage texture is applied, then the normal texture disappears. Any way to deal with that?
“Red Four, nothing’s gone wrong yet.”
— Hobbie Klivian

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Thu Sep 23, 2021 11:12 pm

DarHan wrote:
Thu Sep 23, 2021 6:14 pm
It looks great, but I noticed that sometimes, if I destroy one of the turrets and the damage texture is applied, then the normal texture disappears. Any way to deal with that?
Ah, that sounds like a bug! I'm going to take a look. Thanks for reporting this!

User avatar
Marcos_Edson
XWAU Member
Posts: 2241
Joined: Fri Jan 14, 2000 12:01 am
Contact:

Post by Marcos_Edson » Fri Sep 24, 2021 1:51 am

Whoa! Amazing! It's getting hard to believe it's still the same game!
SETI
"There can be only one..."
"I'm an otaku! Have a problem with that?"

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Fri Sep 24, 2021 8:31 am

Unless I am missing something else and yes I am ignoring the normal mapping for a moment the closest graphics process this represents is "Detail Mapping"
Detail Mapping is a repeatable texture blended with the base texture (usually at multiple texels per base texel) at high magnifications (base texels take up many pixels on screen).

While Detail textures are usually just fuzzy, Blue has managed to create a whole other layer including the normal mapping.

Trev

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat Sep 25, 2021 4:20 am

Trevor wrote:
Fri Sep 24, 2021 8:31 am
Detail Mapping is a repeatable texture blended with the base texture (usually at multiple texels per base texel) at high magnifications (base texels take up many pixels on screen).
Ah! Very interesting! Yes, it sounds like that's pretty much the same thing. Thanks for the information! I just did a quick search on the web and it's given me a few ideas on how to store detail textures more efficiently (2 channels for the normal map, 1 channel for grayscale detail, 1 channel for glossy detail). That's good because using up texture slots can be expensive and it will impact the performance too, so it's always good to do it as efficiently as possible.

User avatar
JeremyaFr
XWAU Member
Posts: 3921
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Sep 25, 2021 12:05 pm

Nice :thumbs:

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sun Sep 26, 2021 5:37 am

DarHan wrote:
Thu Sep 23, 2021 6:14 pm
It looks great, but I noticed that sometimes, if I destroy one of the turrets and the damage texture is applied, then the normal texture disappears. Any way to deal with that?
I just fixed this bug. Please the download the latest beta. Again, thanks for reporting the issue!

Hey Jeremy! Thanks for your comment, nice to see you around here!

User avatar
DarHan
Rebel Alliance
Posts: 325
Joined: Mon Dec 05, 2005 12:01 am
Contact:

Post by DarHan » Sun Sep 26, 2021 3:36 pm

Yup, the detail texture now remains when the damage texture is applied.
“Red Four, nothing’s gone wrong yet.”
— Hobbie Klivian

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon Sep 27, 2021 8:55 pm

Here's another teaser video:

https://www.youtube.com/watch?v=sE9jed02Ly0

The latest ddraw beta already supports this feature. I'll publish the sample Asteroid from that video soon, as another example of how to use this feature.

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Tue Sep 28, 2021 10:54 am

looks awsome, but I must say that "greebles" sound 3d and when I first started watching the video I thought you had actually implemented "greebles" untill I seen that it was a 2 level Detail Map.

But yeah, this now makes large surfaces enjoyable in XWA (instead of being a huge blur that suddenly darkens - as seen on your left screen)

Trev

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Tue Sep 28, 2021 12:40 pm

blue_max wrote:
Mon Sep 27, 2021 8:55 pm
Here's another teaser video:

https://www.youtube.com/watch?v=sE9jed02Ly0

The latest ddraw beta already supports this feature. I'll publish the sample Asteroid from that video soon, as another example of how to use this feature.
Looks great. This was what I was wanted to see on the Asteroid Pirate Base. It keeping its detail up close. So that would be a good one to look at and the hangar rock too
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Wed Sep 29, 2021 3:21 am

Ace Antilles wrote:
Tue Sep 28, 2021 12:40 pm
Looks great. This was what I was wanted to see on the Asteroid Pirate Base. It keeping its detail up close. So that would be a good one to look at and the hangar rock too
Yes, the asteroid base will benefit greatly from this feature. It should be easy to do now!

@Trevor actual 3D greebles may be within the realm of possibility. I want to get there at some point, but I'm taking baby steps ;)

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Thu Sep 30, 2021 10:48 am

blue_max wrote:
Wed Sep 29, 2021 3:21 am
@Trevor actual 3D greebles may be within the realm of possibility. I want to get there at some point, but I'm taking baby steps ;)
I just knew you were thinking about greebles, hence why I posted the Detail Map definition ;) haha

Im guessing greebles could be placed by either a special texture map (where each 8bit texel represents a greeble type and location, 0 = none, 1 = first(eg rock), 2 = second (eg gun) etc) or at random.

Asteroids would have random greebles while ISDs could use a map to signify where guns and other superstructure go.

Trev

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Thu Sep 30, 2021 5:54 pm

I was actually thinking of something slightly different: height maps. The approach you're describing requires that our textures be lossless and "more discrete" (what should I do if instead of "1:rock" or "2:gun", I read "1.37" from the greeble map?). This can be done, of course, but I wonder what would happen in those cases (maybe drop the fractional part and move on?)

Post Reply