Jump to content


Photo
- - - - -

[MOD] Terrain bump-mapping


  • Please log in to reply
106 replies to this topic

#1 AnKor85

AnKor85
  • Posts: 1002

Posted 07 November 2013 - 23:04

UPDATE
Latest version with support for all seasons.
Normal version. For use in "Mods ON":
Attached File  Terrain Bump (Mods ON, Jan27).zip   13.59KB   345 downloads

Special version, which can be used in "Mods OFF" mode (for multiplayer).
Attached File  Terrain Bump (Mods OFF, Jan27).zip   100.18KB   236 downloads

See this post if for more info: Re: [MOD] Terrain bump-mapping

You can enable both versions at the same time. There is one "conflicting" file (texturerender.bin) which exists in both archives, but it is actually identical in both versions.

The picture below doesn't represent this version. :)

————————–

So I decided to add some volume, at least visual, to the terrain.
Attached File  TerrainBump.jpg   422.66KB   3003 downloads
Check the bigger picture. If you don't see the effect then this mod is not for you :)

Actually it adds shaded borders (so called bump-mapping) to rivers and dirt roads. I also want to try to do the same for "real" roads, but not sure yet if it is possible.

The mod is experimental (as always with my mods) and may need some tweaking. Also I'm not sure yet how much FPS it eats, but seems to work ok.
Right now it supports summer and autumn seasons on all maps except the Channel. Winter maps are no supported too.
It may produce some artifacts visible on the ground, but should be mostly ok. Please report any oddities if you are interested in this mod.

JSGME-ready archive is attached.
For better results this archive also includes my "smart blur" mod updated to work with 1.031, because the old version has become incompatible.

Be careful, if you get too used to this you won't be able to play "mods off" :)
  • 0

#2 hq_Jorri

hq_Jorri
  • Posts: 14143

Posted 07 November 2013 - 23:40

Ooh ooh ooh, are no man's land craters in reach also!?

Gotta try this out! Thanks for your continued contributions!
  • 0

#3 Feathered_IV

Feathered_IV
  • Posts: 1572

Posted 07 November 2013 - 23:50

Very exciting. Well done AnKor! I remember when I was trying to get bump mapping to show up and you said it wouldn't work and I was wasting my time. Glad you found a way. ;)
  • 0

#4 HotTom

HotTom
  • Posts: 8177

Posted 08 November 2013 - 02:33

Wow! VERY nice!

Took it for a ride with very low sun and the effect is great!

Thank you!

:S!:

HT
  • 0

#5 WW1EAF_Paf

WW1EAF_Paf
  • Tester
  • Posts: 1458

Posted 08 November 2013 - 05:58

Good work AnKor,

does this work by colour-detection?
  • 0

#6 AnKor85

AnKor85
  • Posts: 1002

Posted 08 November 2013 - 08:10

does this work by colour-detection?
Yes, I think you already noticed while making your own textures that blue color channel on summer maps is almost exclusively used by dirt roads. So right now it just uses blue channel as a height map. I believe it may be improved by writing a better color->height filter, like something similar to my own smart blur filter which detects sharp edges. Then we will see bump mapping at field edges too.
I just posted the first working version which took me all evening to make because I was curious to see how people react :)
Well, and because I'm not sure when I'll have time to work on it again.

The water however is already detected exactly - the data is available to the shader.

I remember when I was trying to get bump mapping to show up and you said it wouldn't work and I was wasting my time. Glad you found a way. ;)
You see, as I described above I didn't get any normal or height map into the game, it is still impossible. I just used a trick to derive something that works as a height map from texture colors.

are no man's land craters in reach also!?
Haven't tried yet, but it is a good idea.
This mod has an interesting side effect on no-mans land - it still adds bump to dirt-roads which are hidden under the "moon texture". I don't have a screenshot here, but I think the change looks curious and I'm going to keep it.


The bad side effect is that there are some seams appearing in the ground textures. However they doesn't seem to be too distracting when actually flying and not just looking for them. I'm not sure if they can be corrected in reasonable time, however.
  • 0

#7 Major_Marvel

Major_Marvel
  • Posts: 83

Posted 08 November 2013 - 08:32

Thanks AnKor it looks really good,very nice thanks
  • 0

#8 WW1EAF_Paf

WW1EAF_Paf
  • Tester
  • Posts: 1458

Posted 08 November 2013 - 13:05

This mod has an interesting side effect on no-mans land - it still adds bump to dirt-roads which are hidden under the "moon texture".

Thats cool!
  • 0

#9 ChiefRedCloud

ChiefRedCloud
  • Posts: 2847
  • LocationWaleska, Georgia, USA

Posted 08 November 2013 - 13:26

Cool stuff …. I look forward to trying …
  • 0

G5fCmYF.png

NEW WINGS VIRTUAL FLIGHT TRAINING

"Hardcore Through Passion"


#10 AnKor85

AnKor85
  • Posts: 1002

Posted 08 November 2013 - 14:06

Here is a picture of a quick test with no-mans land (it is NOT included in the mod). I'm not quite satisfied with the look though: I would like it to appear more rough instead of being full of small "noise" - the craters still look painted over the flat ground.
Note how the trenches look even more flat (flatter than flat?) when compared to the terrain :)

Attached File  no-mans-land.jpg   293.57KB   2786 downloads Attached File  no-mans-land-2.jpg   342.05KB   2783 downloads
  • 0

#11 hq_Jorri

hq_Jorri
  • Posts: 14143

Posted 08 November 2013 - 15:31

This looks more like an overlay than the waterside-dirtroad mod.

Would it be possible to do with the edges of craters what you did with the dirt roads?
  • 0

#12 WW1EAF_Paf

WW1EAF_Paf
  • Tester
  • Posts: 1458

Posted 08 November 2013 - 16:23

The "problem" is, that it is not a bumpmap of the texture you see ingame. So it will be very hard to get a crater-effect. But lets see what magic AnKor can put out :D
  • 0

#13 WW1EAF_Paf

WW1EAF_Paf
  • Tester
  • Posts: 1458

Posted 08 November 2013 - 20:20

Sorry AnKor if this is a dumb idea, but I have absolutely no idea how shaders work.
But what I understand is, your shader reads a specific file and takes for example the blue to determine a border-effect.

The nomansland-texture has no Alpha-layer. What about adding a alpha-map (that is not supported by the game)so we won't see any difference in the texture. The alpha_map could redraw the shapes of the craters. Is a shader capable of "reading" a textures alpha-map?
  • 0

#14 AnKor85

AnKor85
  • Posts: 1002

Posted 08 November 2013 - 20:36

But what I understand is, your shader reads a specific file and takes for example the blue to determine a border-effect.
Almost correct: the shader works with a texture provided by the game engine. It may be from a file (like landtypes.dds), but the shader itself has no way to know or control which file it is.

The nomansland-texture has no Alpha-layer. What about adding a alpha-map (that is not supported by the game)so we won't see any difference in the texture. The alpha_map could redraw the shapes of the craters. Is a shader capable of "reading" a textures alpha-map?
Yes, this is actually a viable idea. I already thought about asking if someone can make a height-map for craters which I would add to alpha-layer. Of course at first I have to try some simplest heightmap to see whether it works at all.
The problem here is that the Channel map introduced additional mask textures and now uses all 4 layers: R,G,B and Alpha. So this approach won't work for the Channel as is.

Another thing to keep in mind: bump mapping has its own limitations - deep craters will only look good from high altitudes, down low they will look odd because they will be flat anyway. There's another technique called parallax occlusion to solve this and it is already used in ROF to draw small ground bumps, but my knowledge of shaders is really limited and I don't think I will be able to apply it at larger scale.
  • 0

#15 AnKor85

AnKor85
  • Posts: 1002

Posted 08 November 2013 - 21:26

Here is a very quick test of how it looks with a simple heightmap made by WW1EAF_Paf :)
Attached File  craters.jpg   334.24KB   497 downloads
Attached File  craters2.jpg   369.76KB   495 downloads
The picture is taken from the editor, it may look better in game.

Any comments?
  • 0

#16 WW1EAF_Paf

WW1EAF_Paf
  • Tester
  • Posts: 1458

Posted 08 November 2013 - 21:32

Ok, the heightmap needs some tuning,
but YEAH! :D
  • 0

#17 Feathered_IV

Feathered_IV
  • Posts: 1572

Posted 09 November 2013 - 07:21

I think the craters do indeed have an alpha channel. I found it while doing a rework of the Detail.DDS texture. I'm away from my PC at the moment, but I think it's in the same location and the thumbnail appears red on colour. I'll have to check that this evening and see what it's called.
  • 0

#18 Feathered_IV

Feathered_IV
  • Posts: 1572

Posted 09 November 2013 - 11:43

Found it. It's the Landtypes.dds texture that occurs in the Landscape folder etc. The blue channel has the noman's land crater texture, which is identical in layout to the type3.dds crater texture. The green channel seems to be the forest base or distant layer. Not sure about the red though… Hope that helps in some way. :?
  • 0

#19 SYN_Mars

SYN_Mars
  • Posts: 137

Posted 09 November 2013 - 12:12

Excellent stuff! Can anything be done with the trench texture?
  • 0

#20 gavagai

gavagai
  • Posts: 15539

Posted 09 November 2013 - 12:33

Nice work Ankor. Can this be used with fubar's terrain textures, I wonder? I will try it out.

—————

Yes, they are compatible. Great! :S!:
  • 0

#21 WW1EAF_Paf

WW1EAF_Paf
  • Tester
  • Posts: 1458

Posted 09 November 2013 - 14:05

It should work Gav. The bumpmap of the roads also works for the roads I painted.
  • 0

#22 AnKor85

AnKor85
  • Posts: 1002

Posted 09 November 2013 - 14:06

Found it. It's the Landtypes.dds texture that occurs in the Landscape folder etc. The blue channel has the noman's land crater texture, which is identical in layout to the type3.dds crater texture. The green channel seems to be the forest base or distant layer. Not sure about the red though… Hope that helps in some way. :?
The red one is the sand around rivers.
Thanks for looking it up but I actually know it. Note that type1/2/3.dds textures are leftovers from older versions of the game and only changes to landtypes.dds has any effect.
The Channel map has 4 types of mask texture: cliffs, forest, sand and mud, and there's no free space for heightmap.

Excellent stuff! Can anything be done with the trench texture?
Something like this?
Attached File  trenches.jpg   410.44KB   858 downloads
I also had to add a height map into the alpha channel, and made the floor brighter (instead of black) to better show the highlights.

However, there's one problem, if you haven't noticed yet: the sun is in the upper-right corner, but where are highlights? Roads and trenches use different own coordinate space and I have yet to figure out how to transform it into world's coordinates. I believe it should be possible.

This screenshot also uses height data for craters but with more tweaking than the previous one. I don't know for everyone, but for me it suffers from multistable perception (http://en.wikipedia....able_perception" onclick="window.open(this.href);return false;">http://en.wikipedia....able_perception) where I see craters as bumps :)

Nice work Ankor. Can this be used with fubar's terrain textures, I wonder? I will try it out.

—————

Yes, they are compatible. Great! :S!:
It should be compatible with any textures. Just not the winter ones and not the Channel because they use different shaders.

Meanwhile I also added some bump to fields:
Attached File  fields.jpg   171.78KB   856 downloads
Trying to keep it subtle but still visible.
It works in the same way but instead of just using the blue channel, it combines 80% of blue, 15% of red and 5% of green color to simulate height data.

I will publish improved version when it is ready :)
  • 0

#23 Feathered_IV

Feathered_IV
  • Posts: 1572

Posted 09 November 2013 - 14:48

This screenshot also uses height data for craters but with more tweaking than the previous one. I don't know for everyone, but for me it suffers from multistable perception (http://en.wikipedia....able_perception" onclick="window.open(this.href);return false;">http://en.wikipedia....able_perception) where I see craters as bumps :)

I thought that was just me! I've had the same thing in a different mod for a different sim that I've been working on. After a time I keep thinking I'm looking at little domes. :geek:


Image
  • 0

#24 hq_Jorri

hq_Jorri
  • Posts: 14143

Posted 09 November 2013 - 20:04

Exciting stuff!

I think for no man's land, the bumpitybumpity effect is too big, it looks too rough, is there not a way to ONLY have an effect for the craters, and not the bumpy effect?
  • 0

#25 WW1EAF_Paf

WW1EAF_Paf
  • Tester
  • Posts: 1458

Posted 09 November 2013 - 20:11

Yes its possible. The heightmap in use is actually a really quick made one. With some finetunig there should be more believable results. But the best is, it works :)
  • 0

#26 Spag

Spag
  • Posts: 2167
  • LocationAustralia

Posted 10 November 2013 - 00:06

Hello AnKor,
Well done.
I am spending more time looking at the scenery than looking for enemy planes.
Thanks for all your effort.
Cheers,
Spag. :)
  • 0

Bite off more than you can chew.

Then chew like Hell ! ! !


#27 Dietz

Dietz
  • Posts: 232

Posted 11 November 2013 - 16:03

Great idea- many thanks for your efforts! :S!:
  • 0

#28 AnKor85

AnKor85
  • Posts: 1002

Posted 12 November 2013 - 10:05

Here is updated version. Should produce more correct results (previous one messed original lighting too much). It is still too far from being perfect and occasionally has really visible seams in textures. And perhaps the bump is over exaggerated here, but I'm a bit tired of fine-tuning so will leave it as is for now. Maybe I'll get back to it later.

Trenches is not included because I still don't like how they look.
Also I didn't use any custom height map for no-man's land.
Still works with summer and autumn seasons only and not for the Channel.
Attached File  bump2.jpg   505.42KB   706 downloads

Attached Files


  • 0

#29 Spag

Spag
  • Posts: 2167
  • LocationAustralia

Posted 12 November 2013 - 13:04

Hello Ankor,
Many thanks for the time you have put into this.
It looks great and I certainly look forward to any tweaks that you do in the future.
Cheers,
Spag. :)
  • 0

Bite off more than you can chew.

Then chew like Hell ! ! !


#30 Hellshade

Hellshade
  • Posts: 775

Posted 21 November 2013 - 20:33

Brilliant work Ankor. It adds a wonderful sense of depth to the terrain. Thank you for sharing this with everyone.
  • 0

#31 Der.Mo

Der.Mo
  • Posts: 998

Posted 21 November 2013 - 23:56

Definately an improvement! Thanks Ankor!
  • 0

#32 ChiefRedCloud

ChiefRedCloud
  • Posts: 2847
  • LocationWaleska, Georgia, USA

Posted 22 November 2013 - 00:12

AnKor this should be put in ALL the maps we have as a normal thing. It's nice to see things that do not look like a faded pallet.
  • 0

G5fCmYF.png

NEW WINGS VIRTUAL FLIGHT TRAINING

"Hardcore Through Passion"


#33 AnKor85

AnKor85
  • Posts: 1002

Posted 22 November 2013 - 09:56

Thanks people! Glad you like it :)
Though the number of downloads is rather small, but well, so is the forum attendance nowadays.

When I get some free time I'll try to work on this mod a bit more to fix some issues (texture seams, argh!) and add support for winter maps and the Channel.
  • 0

#34 =AxA=V.Alexx

=AxA=V.Alexx
  • Posts: 138

Posted 25 November 2013 - 01:11

I tried it. great work! keep it up :S!:
  • 0

#35 J5_Rumey

J5_Rumey
  • Posts: 1180

Posted 25 November 2013 - 12:32

Nice thank you!
  • 0

#36 Blade_meister

Blade_meister
  • Posts: 1321

Posted 25 November 2013 - 13:42

Thanks people! Glad you like it :)
Though the number of downloads is rather small, but well, so is the forum attendance nowadays.

When I get some free time I'll try to work on this mod a bit more to fix some issues (texture seams, argh!) and add support for winter maps and the Channel.

AnKor, don't forget that gavagai has your mod included in ROF Refined .21 so, many people may be getting it there and not through your download. I really love what you have done and hope that you will have time to apply this to the the Winter maps and to the Channel Map. Thanks for all that you do Sir! :S!:

S!Blade<><
  • 0

#37 =KAG=Dron

=KAG=Dron
  • Posts: 320

Posted 25 November 2013 - 16:04

:S!:
  • 0

#38 Joker_BR

Joker_BR
  • Posts: 509

Posted 25 November 2013 - 22:30

I am one of those who got it through "rof refined", so add +1 to your download counter.
Thanks Ankor.
  • 0

#39 AnKor85

AnKor85
  • Posts: 1002

Posted 26 November 2013 - 09:50

AnKor, don't forget that gavagai has your mod included in ROF Refined .21 so, many people may be getting it there and not through your download.
Ah, that's cool :)

Now I need some input.
Here I finally figured out how to add (almost correct) bump mapping to trench lines. It is not the final version - since I have to combine height data with alpha channel it doesn't blend well with the ground and I have yet to draw a better version.
Another change is that I tried to add irregularities to zipper pattern, not sure if it makes the look any better.
What do you think?
Attached File  trenchlines.jpg   484.19KB   438 downloads

And here is a quick attempt at winter textures:
Attached File  winter.jpg   353.82KB   437 downloads
I had to make it much subtler due to more contrast colors otherwise the snow looked like a plastic. Still have to fine tune it.
  • 0

#40 BaronVonMyakin

BaronVonMyakin
  • Posts: 343

Posted 26 November 2013 - 09:56

What do you think?
Mucho perfecto! :S!:
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users