Automatic Greebler & True Normal Mapping
Automatic Greebler & True Normal Mapping
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
I've been working on a new effect: the Automatic Greebler. In a few words, this shader will automatically add details to any surface as needed, depending on how close you are. The basic idea is that no matter how close you fly to an object, there will always be small details on its surface (the actual implementation has limitations, but that's the general idea). This shader works better for large objects where pixelation can be easy to notice. It's easier to see this with pictures.
Here's the first example. This is a big (10km wide) asteroid. It already has a 2k texture, but it looks like this ~2km away:
This is what it looks like when the Auto Greebler is turned on:
The greebles are generated by gradually blending the current OPT's texture with an external texture that provides the greebles, depending on how far is the surface from the camera. The same greeble texture can be shared among several OPTs, but we can also have custom greeble textures for specific OPTs. I've currently implemented Multiplication, Overlay, Screen, Replace and Normal Mapping blending modes. The images above are a combination of a Normal Map and an Overlay map.
Also, I finally implemented support for true Normal Mapping. It took me a while because I'm not using any tangent maps, as in other engines. So, the material system will soon support true Normal Mapping as well.
Here's the first example. This is a big (10km wide) asteroid. It already has a 2k texture, but it looks like this ~2km away:
This is what it looks like when the Auto Greebler is turned on:
The greebles are generated by gradually blending the current OPT's texture with an external texture that provides the greebles, depending on how far is the surface from the camera. The same greeble texture can be shared among several OPTs, but we can also have custom greeble textures for specific OPTs. I've currently implemented Multiplication, Overlay, Screen, Replace and Normal Mapping blending modes. The images above are a combination of a Normal Map and an Overlay map.
Also, I finally implemented support for true Normal Mapping. It took me a while because I'm not using any tangent maps, as in other engines. So, the material system will soon support true Normal Mapping as well.
You do not have the required permissions to view the files attached to this post.
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
More examples, of the same asteroid:
You do not have the required permissions to view the files attached to this post.
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
You do not have the required permissions to view the files attached to this post.
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
This is the SSD, here we have greebles generated with a normal map, and lightmap greebles, applied using the Screen blending mode:
You do not have the required permissions to view the files attached to this post.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear
Vince T's X-Wing HQ - where the bad guys get their gear
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
The SSD again:
You do not have the required permissions to view the files attached to this post.
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
And always remember that a smile is cheaper than a bullet! (District 9)
Webmaster of the X-Wing Alliance Upgrade Project
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
Thanks for your comments, guys! Here's a few more. I've exaggerated the effect a little bit, to make it noticeable, but it can be fine-tuned and we can even use texture masks to define areas where greebles are to be applied:
You do not have the required permissions to view the files attached to this post.
- the_stag
- Posts: 134
- Joined: Sun Jun 14, 2020 3:47 pm
This is amazing. Simply amazing. I cannot wait to see these in action on my own PC. Now if the price of video cards would come down...
-
- Posts: 213
- Joined: Fri Dec 27, 2019 7:08 pm
This is a massive step forward !!! Wating to see the final result.
-
- Posts: 1170
- Joined: Mon Apr 05, 2004 11:01 pm
Superb job BlueMax. So the general idea is it would no longer be necessary to implement complex HD textures on the larger .opt models themselves, because they could be replaced dynamically with these external HD greeble textures. This could improve performance if the overhead is shifted from the .opt models to the shader effect. (?) Do external texture sizes have to match the original skins ?
This concept would be great too for the background .dat files (static and animated) .... approaching planets, orbital views of planets, stars/suns/galaxies, death star surface, and planet atmospheric mission level surfaces, deserts, forests, mountains, oceans, city landscapes, etc. Probably a lot of different .dat files.
This concept would be great too for the background .dat files (static and animated) .... approaching planets, orbital views of planets, stars/suns/galaxies, death star surface, and planet atmospheric mission level surfaces, deserts, forests, mountains, oceans, city landscapes, etc. Probably a lot of different .dat files.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- Forceflow
- Posts: 7218
- Joined: Wed Oct 20, 1999 11:01 pm
- Contact:
No you still need HD textures for the ships, especially the large ones. It's just that for the really big ones those will add additional detail once you get closer to them. If you would scale the new ones up they would end up at something like 16k and more. (Looking at the asteroid possible a LOT more) That would make the OPT size ridiculous. The current HD textures don't really impact render performance, that's actually mostly done by the GPU. Issue still is the geometry of the OPTs. That's what's unfortunately being done in a single CPU thread.Bman wrote: ↑Tue Sep 14, 2021 7:17 amSuperb job BlueMax. So the general idea is it would no longer be necessary to implement complex HD textures on the larger .opt models themselves, because they could be replaced dynamically with these external HD greeble textures. This could improve performance if the overhead is shifted from the .opt models to the shader effect. (?) Do external texture sizes have to match the original skins ?
This concept would be great too for the background .dat files (static and animated) .... approaching planets, orbital views of planets, stars/suns/galaxies, death star surface, and planet atmospheric mission level surfaces, deserts, forests, mountains, oceans, city landscapes, etc. Probably a lot of different .dat files.
So you wont get more performance out of this, just better looking details up close.
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
And always remember that a smile is cheaper than a bullet! (District 9)
Webmaster of the X-Wing Alliance Upgrade Project
-
- Posts: 136
- Joined: Sun Nov 09, 2008 9:37 pm
That is very impressive! But I gotta wonder what it does to performance? I'm not playing 20 year old games because i have the latest gaming PC, ya know?
- haui
- Posts: 122
- Joined: Mon Apr 15, 2019 9:29 am
- Contact:
That's a big step forward. The game looks now soooo good and that is the dot on the i
It's better to burn out than to fade away .
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
100% correct.Forceflow wrote: ↑Tue Sep 14, 2021 8:54 amNo you still need HD textures for the ships, especially the large ones. It's just that for the really big ones those will add additional detail once you get closer to them. If you would scale the new ones up they would end up at something like 16k and more. (Looking at the asteroid possible a LOT more) That would make the OPT size ridiculous. The current HD textures don't really impact render performance, that's actually mostly done by the GPU. Issue still is the geometry of the OPTs. That's what's unfortunately being done in a single CPU thread.
So you wont get more performance out of this, just better looking details up close.
For larger OPTs, it becomes really difficult to provide textures that have enough detail unless you increase the size of the texture to a ridiculous size, like 16K. This is a helper for those situations. The asteroid above is 10km wide and it's using 2K texture. Even flying at ~2km distance you can see the texture is badly pixelated. With the Auto Greebler, the details are "filled in" with another 2K texture as needed.
EDIT: Forgot to mention, the greeble textures are repeated over the UVs of the original texture, so it's better to use seamless textures for greebles. However, the repetition can be set to 1 and then the greeble texture is just blended with the original one time.
This does have some performance impact, I've noticed about 5-10% drop in FPS, so we can't go crazy with this shader either.
@Bman those are great ideas. In fact, at some point I'd like to be able to apply this effect to the Death Star itself.
On the other hand, as I mentioned earlier, I ended up implementing proper Normal Mapping for this effect. So we'll have that in our material system soon as well. This means that we can potentially bake the normals from OPTs with higher detail into OPTs with a lower polygon count (wherever it makes sense to do so) and then we can use the lower-poly version in-game. So we might be able to increase performance in that direction by saving some geometry.
And then, of course, there's this thing called Displacement Mapping, which might be possible in the future since DX11 supports both the Geometry Shader and the Tessellator...
-
- Posts: 13
- Joined: Mon Jan 06, 2020 9:32 pm
This is awesome! Is it possible to see a video of this in action?
- haui
- Posts: 122
- Joined: Mon Apr 15, 2019 9:29 am
- Contact:
Displacement Mapping would be great. that will bring the game to a complete new Level.
The computers today should have enough power for this when you play in FULL-HD. OK i know the trend is playing in 4K but i think the guys who want to play in 4k will spend the money for the new hardware.
The computers today should have enough power for this when you play in FULL-HD. OK i know the trend is playing in 4K but i think the guys who want to play in 4k will spend the money for the new hardware.
It's better to burn out than to fade away .
- blue_max
- Posts: 2296
- Joined: Wed Mar 20, 2019 5:12 am
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear
Vince T's X-Wing HQ - where the bad guys get their gear
- rogue518
- Posts: 2866
- Joined: Wed Jul 12, 2000 11:01 pm
- Contact:
I agree with Vince T, you can see the difference...... especially the side-by-side video portion.
Sincerely, Rogue518
Sincerely, Rogue518
'Stay in Attack formation!' Darth Vader aka: Anakin Skywalker During the 'Battle Of Yavin'
- theonegalen
- Posts: 74
- Joined: Mon May 18, 2020 11:39 pm
Holy crap @blue_max !
You absolute wizard! Every time I think the XWA engine has been pushed to the bleeding edge and can't be pushed further, you come up with yet another giant leap forward.
You absolute wizard! Every time I think the XWA engine has been pushed to the bleeding edge and can't be pushed further, you come up with yet another giant leap forward.
- haui
- Posts: 122
- Joined: Mon Apr 15, 2019 9:29 am
- Contact:
ok after the video i think thos is a MUST HAVE
It's better to burn out than to fade away .