Board index FlightGear Development Effects and shaders

models shader with bumpspec and reflect

An exciting "new" option in FlightGear, that includes reflections, lightmaps, the particle system etc.. A lot is yet to be discovered/implemented!

Re: models shader with bumpspec and reflect

Postby HHS » Tue Sep 21, 2010 11:03 am

Image

Using second fix and a modified map.
Up, up and away
User avatar
HHS
 
Posts: 3625
Joined: Thu Jul 19, 2007 9:09 am
Version: GIT

Re: models shader with bumpspec and reflect

Postby i4dnf » Tue Sep 21, 2010 12:50 pm

That looks just like aluminium skin... great. So you've modified the alpha in the normalmap?

ot: I see you-ve managed to take it up for a spin :P
i4dnf
Retired
 
Posts: 743
Joined: Wed Sep 09, 2009 8:17 am
Location: LRBS
Callsign: YR-I4D
Version: GIT
OS: Gentoo Linux ~amd64

Re: models shader with bumpspec and reflect

Postby HHS » Tue Sep 21, 2010 12:59 pm

In Gimp I have added a layer above the bumpspecmap and added "plasma". I made it black and white, set color white to transparency and combined it all.
I set the reflection itself only subtil and changed the cubemap.

If you want I can upload it for you together with my settings.

Edit: yep, but it is more difficult to lift off than a heli! :D
Up, up and away
User avatar
HHS
 
Posts: 3625
Joined: Thu Jul 19, 2007 9:09 am
Version: GIT

Re: models shader with bumpspec and reflect

Postby HHS » Tue Sep 21, 2010 1:03 pm

Btw- I noticed maybe a bug- the specualr is only visible against sun - not with as I would expect.
Up, up and away
User avatar
HHS
 
Posts: 3625
Joined: Thu Jul 19, 2007 9:09 am
Version: GIT

Re: models shader with bumpspec and reflect

Postby i4dnf » Tue Sep 21, 2010 1:11 pm

Yeah, that would be great if you could upload it somewhere.
what would be even more.. if I would manage to make it change the effect with the livery ;) (if i remember correctly there were some liveries that chnaged the model "parts" too? ), and maybe get myself to pack a new beta version of it... since the fdm has changed a lot since the last release :P.

HHS wrote:Btw- I noticed maybe a bug- the specualr is only visible against sun - not with as I would expect.

well, it should be visible either against it, or if you manage to find the spot between the sun and the object where the "light rays" get reflected towards the sun. Usualy when the sun is low it's easier to get them against it, and when it is up it's easier to get them from between the sun and the plane.
i4dnf
Retired
 
Posts: 743
Joined: Wed Sep 09, 2009 8:17 am
Location: LRBS
Callsign: YR-I4D
Version: GIT
OS: Gentoo Linux ~amd64

Re: models shader with bumpspec and reflect

Postby HHS » Tue Sep 21, 2010 1:44 pm

i4dnf wrote:Yeah, that would be great if you could upload it somewhere.

Update available under http://www.hoerbird.net/IAR80-update.tar.gz.
what would be even more.. if I would manage to make it change the effect with the livery ;) (if i remember correctly there were some liveries that chnaged the model "parts" too? ), and maybe get myself to pack a new beta version of it... since the fdm has changed a lot since the last release :P.

Yep, changing the fuselage is possible together with the livery. Take a look on the Bo105 or EC135, they change objects together with the livery.
I also would like the see changing the effect together with the livery itself. But for some airliners that will be too difficult that way. It would be great if we could change the greymap or specularbumpmap in runtime.

well, it should be visible either against it, or if you manage to find the spot between the sun and the object where the "light rays" get reflected towards the sun. Usualy when the sun is low it's easier to get them against it, and when it is up it's easier to get them from between the sun and the plane.


Sometimes it seems to look weird. But I'm not sure...
Up, up and away
User avatar
HHS
 
Posts: 3625
Joined: Thu Jul 19, 2007 9:09 am
Version: GIT

Re: models shader with bumpspec and reflect

Postby i4dnf » Tue Sep 21, 2010 2:42 pm

I've just tested it, and realised what you did. A little mistake :P. you should have applied the "plasma" effect just to the alpha channel.. not a layer over the whole image.. that way you've affected the normals info in the texture.
The right workflow would be to create a new image of the same size, apply the plasma efect there, select it all and copy...
then in the original image, rightclick the layer -> add layer mask -> layer's alpha channel
paste the "plasma"(make shure the mask is active) -> right click the new layer -> anchor layer
then rightclick the layer -> apply layer mask.
then save/export as png selecting "save color values for transparent pixels".
i4dnf
Retired
 
Posts: 743
Joined: Wed Sep 09, 2009 8:17 am
Location: LRBS
Callsign: YR-I4D
Version: GIT
OS: Gentoo Linux ~amd64

Re: models shader with bumpspec and reflect

Postby HHS » Tue Sep 21, 2010 2:45 pm

Whoops- I never thought that it will influence the normals. :oops:

Thanks, I will try again.
Up, up and away
User avatar
HHS
 
Posts: 3625
Joined: Thu Jul 19, 2007 9:09 am
Version: GIT

Re: models shader with bumpspec and reflect

Postby HHS » Sat Sep 25, 2010 12:40 pm

Me again...

I've played with this shader now alot. Found out how to change the strength of reflection in runtime. (I only have to find out if we can change the map used for bump and/or reflection as well)

With all the playing around I noticed that the last version lacks of one feature: the specular effect itself.

In the first version we could map:

Specular effect =(sun reflection): this was per alpha channel in normalmap
Bump effect = the normalmap it self
Reflection strength = per shininess of the material; per refl_correction in the eff.file; per greymap

With the last version:
specular effect can't be mapped anymore, the alpha channel is now used for reflection strength; greymap isn't working as well anymore.

I must admit that I still prefer the first version, which gives more freedom and better effects.

What do you think about? :|
Up, up and away
User avatar
HHS
 
Posts: 3625
Joined: Thu Jul 19, 2007 9:09 am
Version: GIT

Re: models shader with bumpspec and reflect

Postby fredb » Sat Sep 25, 2010 3:35 pm

Hi Heiko,

can you confirm that changing line 100 of reflect-bump-spec.frag that reads :
Code: Select all
    reflFactor = clamp(reflFactor * ns.a, 0.0, 1.0);
into :
Code: Select all
    reflFactor = clamp(reflFactor, 0.0, 1.0);
fix your problem ?
User avatar
fredb
 
Posts: 753
Joined: Fri Dec 01, 2006 11:41 am
Location: Paris, France

Re: models shader with bumpspec and reflect

Postby HHS » Sat Sep 25, 2010 4:03 pm

Hi Fred,

Confirmed:

Image

Hope we will find in near future a way to change the maps in runtime as well! Strength of reflection generelly is already possible.

Thanks again!
Up, up and away
User avatar
HHS
 
Posts: 3625
Joined: Thu Jul 19, 2007 9:09 am
Version: GIT

Previous

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 9 guests