Jump to content


Graphic issue


  • Please log in to reply
21 replies to this topic

#1 thl

thl

    Honored Member

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 312 posts
  • Gender:Male

Posted 03 July 2014 - 11:20 AM

I wanted to know if it's possible to simulate an effect we call "Verblauung" in German, I don't know the correct word in English. It means things are appearing a bit bluish, when they are far away. Saturation decreases too.

I tried to play with the values of the fog effect until I was happy with the result.
I added these lines at the end of the track.ini file of Monza 10k, my test track.

[ fog ]
type = 1
density = 1.5
fog_r = 165
fog_g = 200
fog_b = 250

The result is reduced saturation in the distance with some shift in hue towards blue. The thing I wanted to get (screenshot attached).

It's really good for tracks like Monza 10k, where you don't have important horizon textures with lots of details, because that's the drawback: This change affects all textures, the horizon textures nearly disappear.

And here's my question: Is there a way to exclude the horizon textures from this fog effect or is there another way to create this effect?

Thomas Laechele

Attached Files



#2 sky

sky

    ultra highres junkie

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 3,226 posts
  • Gender:Male
  • Location:Krautlandia

Posted 03 July 2014 - 02:39 PM

Hi Thomas, I think the only possible way would be to rewrite a .mip encoder that saves the submips with slightly adapted colours. I'm assuming you would be using a fixed shift per iteration, but even if not, it would just be separate calculations on a per level basis.

#3 MECH

MECH

    Double poly killer

  • Administrators
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 4,447 posts
  • Gender:Male
  • Location:Netherlands, Almelo

Posted 03 July 2014 - 02:45 PM

GPL uses 3do classes to apply effects on the object.
I don't know what class the horizon 3do uses but it might be a solution to use another class?
I know for fact that in cars the classes are used to blank out the driver textures.
It all depends on if the fog effect uses the classes or just the presence of a horizon.3do object.
Or just applies it no matter what :think:

Cheers,

Martin


#4 TvO

TvO

    Honored Member

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 2,316 posts
  • Gender:Not Telling

Posted 04 July 2014 - 03:43 AM

I agree with Roman, altering mips with new subimages seems to best workaround. But a lot of work :D .

#5 ginetto

ginetto

    Master Tracker

  • Administrators
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 10,714 posts
  • Gender:Male
  • Location:Lombardia ITALIA

Posted 04 July 2014 - 05:00 AM

When Nigel was around and developed the fog effect, I asked him if it was possible to exclude the Horizon mips from it.
He said that he could probably do it but then he took off and never came back.

Too bad 'cos the horizon being the farthest thing, just disappear with very little fog values.

About the classes, Martin, can you try using some car class to the horizon 3do and see if you get some results?
Maybe it just gets drawn in front of everything else instead of being behind any other object. :think:

Done these tracks and working on others.


#6 MECH

MECH

    Double poly killer

  • Administrators
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 4,447 posts
  • Gender:Male
  • Location:Netherlands, Almelo

Posted 04 July 2014 - 06:32 AM

View Postginetto, on 04 July 2014 - 05:00 AM, said:

When Nigel was around and developed the fog effect, I asked him if it was possible to exclude the Horizon mips from it.
He said that he could probably do it but then he took off and never came back.

Too bad 'cos the horizon being the farthest thing, just disappear with very little fog values.

About the classes, Martin, can you try using some car class to the horizon 3do and see if you get some results?
Maybe it just gets drawn in front of everything else instead of being behind any other object. :think:

Here's a Monza10k horiz.3do that has class=13 for the sky texture.
I doubt if it works though, i just saw a horiz.3do of Aintree where a class=5 was used which should be class=0. So GPL probably ignores it and just draws the 3do as if it where a track object.

But you never can tell without trying :)

Attached Files


Cheers,

Martin


#7 gliebzeit

gliebzeit

    Targa Fan

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 10,167 posts
  • Gender:Male
  • Location:Florida - USA

Posted 04 July 2014 - 01:20 PM

I just ran tests using Martin's altered horiz.3do file.  ... tried to take screenshots at the same locations.
Test 1 was using this new horiz.3do with Thomas' fog settings.
Test 2 was using the old horiz.3do with Thomas' fog settings.
Test 3 was using the old horiz.3do and NO fog enabled.

Attached Files


Greg

... What's who's name?

#8 MECH

MECH

    Double poly killer

  • Administrators
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 4,447 posts
  • Gender:Male
  • Location:Netherlands, Almelo

Posted 06 July 2014 - 03:16 AM

View Postsky, on 03 July 2014 - 02:39 PM, said:

Hi Thomas, I think the only possible way would be to rewrite a .mip encoder that saves the submips with slightly adapted colours. I'm assuming you would be using a fixed shift per iteration, but even if not, it would just be separate calculations on a per level basis.
How should this work then? A program that reads a setting file which contains a Hue value for all sub levels? Can you be more specific?


P.s. Thx for testing Greg, Didn't have high hopes that it would work.
But atleast we know the classes have little to no efect on track objects :)

Cheers,

Martin


#9 sky

sky

    ultra highres junkie

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 3,226 posts
  • Gender:Male
  • Location:Krautlandia

Posted 06 July 2014 - 09:07 AM

Hi Martin,
our initial idea was to create the submips ourselves as .bmp files. Howevermany levels necessary. Since that never came to, I think the next best thing would be to have a program like papybmp or winmip just take the highest level texture and use a set of values to get the next sublevel based on the previous one - or based on the original level.
I don't know what values Thomas would change and in what way, whether it is a linear change or individual on a per texture basis. I think it is probably the former. Having a settings file would be brilliant as it would allow for customisation for different tracks and lighting scenarios. An overcast sky on a cloudy day has a different viewing distance than a clear sky or a foggy day (obviously).

I should think that the values would maybe not be hue as such, but saturation and a general shift in possibly one colour only. I'm not sure that just adapting the Hue would be a cure-all. If anything I find that changing the Hue impacts colours a lot more in ways I do not want than doing it via colour balance. But let's wait for Thomas' ideas on the matter - or his value set / method to achieve this.

#10 ginetto

ginetto

    Master Tracker

  • Administrators
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 10,714 posts
  • Gender:Male
  • Location:Lombardia ITALIA

Posted 06 July 2014 - 09:49 AM

Winmip with its latest version 2.16.8, already has a tweakable way of adding fog to the sub-images with an adjustable level from 0 to 4.
It would probably work a little tweak to it that let you choose the hue of the fog applied.
I have it called winmip3 (but is not) and keep it together with the earlier version which I usually work with.

Attached Files


Done these tracks and working on others.


#11 TvO

TvO

    Honored Member

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 2,316 posts
  • Gender:Not Telling

Posted 06 July 2014 - 01:25 PM

I think Luna created a track in which he altered the mip subimages himself to test out a way to simulate fog. I think he made it before the V2 rasters.

#12 ginetto

ginetto

    Master Tracker

  • Administrators
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 10,714 posts
  • Gender:Male
  • Location:Lombardia ITALIA

Posted 06 July 2014 - 03:11 PM

He used the function of the last winmip , the one I posted above here

Done these tracks and working on others.


#13 TvO

TvO

    Honored Member

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 2,316 posts
  • Gender:Not Telling

Posted 06 July 2014 - 03:25 PM

Great! Otherwise perhaps it's possible to make it work by hex editing the mip file by hand.

#14 sky

sky

    ultra highres junkie

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 3,226 posts
  • Gender:Male
  • Location:Krautlandia

Posted 07 July 2014 - 12:14 PM

Judging by the size of the mips, they seem to be raw data, so replacing subimages should be possible. But hexediting, are you out of your mind? Unless you can replace large chunks in one sitting, this is not a viable option unless you're off the  SM crowd (wait, didn't we used to have a whipping smilie???). I'd prefer a tool

#15 TvO

TvO

    Honored Member

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 2,316 posts
  • Gender:Not Telling

Posted 07 July 2014 - 12:26 PM

Haha well it should be just a copy / paste thing if you know what you are doing. But I'd take a tool for it any day.

#16 sky

sky

    ultra highres junkie

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 3,226 posts
  • Gender:Male
  • Location:Krautlandia

Posted 07 July 2014 - 12:31 PM

<- This guy grew up hexediting with PC-Tools in Textmode on an 8086, so no, I don't want to go back to that 25 years later when technology has moved on a teensy weensy bit. :)

#17 TvO

TvO

    Honored Member

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 2,316 posts
  • Gender:Not Telling

Posted 07 July 2014 - 01:08 PM

Haha with car editing, sometimes I have no choice! Guru never developed Grand Prix Legends Track Editor far enough to do without it :D .

#18 MECH

MECH

    Double poly killer

  • Administrators
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 4,447 posts
  • Gender:Male
  • Location:Netherlands, Almelo

Posted 07 July 2014 - 01:41 PM

View Postsky, on 07 July 2014 - 12:14 PM, said:

Judging by the size of the mips, they seem to be raw data, so replacing subimages should be possible. But hexediting, are you out of your mind? Unless you can replace large chunks in one sitting, this is not a viable option unless you're off the  SM crowd (wait, didn't we used to have a whipping smilie???). I'd prefer a tool
Yes, they are just some fileheaders with chunks of bitmap rgb values and pixel values.
That's why i asked if you could be more specific. It would be possible to alter the mips directly with help of a setting file where you can set up some colorshift, hue or whatever. Then you could use this tool to rewrite the mips instead of building all bitmaps and convert the manually. Basically you would place this tool in a separate folder and plunge in the mips you want to change then run the tool and it would alter all present mips. It's easier to write a tool that would alter the mips then some sort of winmip with this feature  because there are more parameters and miptypes to deal with and the conversion would also have to be implemented. The tool i'm speaking of would just change the rgb data within the mip and be much simpler (and quicker)

Cheers,

Martin


#19 sky

sky

    ultra highres junkie

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 3,226 posts
  • Gender:Male
  • Location:Krautlandia

Posted 07 July 2014 - 02:23 PM

Well, that would definitely work, too. I like the simplicity of it. To be honest, when I had been looking at the MIP headers I found several things I didn't find an explanation for, so I though "meh". In that regard your suggestion is more elegant. Just replace the "bitmap" data and keep the headers as before. Now we need feedback from Thomas as to what kind of colour shift / hue thing he would need. Not sure how easy or complex a change of saturation would be to implement. At worst we could take a bitmap of before and after saturation / whatnot adjustment and compare the colour values. That way we should be able to determine what type of change to apply. Unless I am mistaken mip is an RGB file type, so the calculation could be different per each of the channels.
Not sure if and how that works on 8bit Mips (is there something like that?) as they should be using a fixed palette across all mip levels - that might pose a problem. Filesize should be up to 1/3 of the larger type7 or so Mips.

#20 thl

thl

    Honored Member

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 312 posts
  • Gender:Male

Posted 08 July 2014 - 01:45 PM

Thank you for all the answers! Right now I don't have typical values for the shift of saturation/brightness/hue, but I can find out.

"Winmip3", as you call it, is a nice thing to play with! I just tested a bit and I think the fog value is not only good for a fog effect, you can create reflections with it too. I used a high fog level for some car and roof textures and the effect is great. When you pass by, brightness changes and you get the impression of an reflecting surface, that's very interesting for me. You can see that on the screenshot attached.
Of course it's a bit difficult if you have different versions of the same texture (low/medium/high res). The effect depends on the number of sub images created, which can be quite different for low and high res texture versions, not to forget the differnt monitor resolutions you can choose.

I made another test with a hill texture we have at Spa67. I used a low fog level. When you are far away it's bright, by coming nearer it gets darker. That's not exactly the effect I wanted to have, but it's not so bad. You can also use it to simulate quick light changes, which can be interesting for circuits with cloudy sky.

Attached Files



#21 gliebzeit

gliebzeit

    Targa Fan

  • Member
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 10,167 posts
  • Gender:Male
  • Location:Florida - USA

Posted 08 July 2014 - 01:51 PM

Very interesting effect!!   The reflection on the car is super.  :)
Greg

... What's who's name?

#22 ginetto

ginetto

    Master Tracker

  • Administrators
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 10,714 posts
  • Gender:Male
  • Location:Lombardia ITALIA

Posted 08 July 2014 - 04:06 PM

Very nice effect Thomas :cool:

Done these tracks and working on others.