Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Nighteyes on January 27, 2013, 03:22:21 am

Title: Question regarding canopy glass
Post by: Nighteyes on January 27, 2013, 03:22:21 am
Is it possible to texture the glass with a semi transparent map? so I could add some small specks of dust and scratches here and there...
also, is there a way to make the reflections have a fresnel effect? so whats in front of you has almost no reflections, and the more it gets to the sides the reflections intensify(like real glass)?
Title: Re: Question regarding canopy glass
Post by: Kobrar44 on January 27, 2013, 03:29:26 am
1st is possible and done all the time in most recent mods. The seconds may be already done by the engine, and if not, you can fake it by shinemap. Alpha channel is responsible for env mapping and higher  alpha on the sides is more reflections there. Won't work if you turn the camera.
Title: Re: Question regarding canopy glass
Post by: Nighteyes on January 27, 2013, 03:57:51 am
from what I could see, most mods don't have a modeled cockpit view, the ones that do have, don't have glass...
I know it could be faked, but the whole point of a modeled cockpit is so you can move the camera around
Title: Re: Question regarding canopy glass
Post by: pecenipicek on January 27, 2013, 04:01:00 am
from what I could see, most mods don't have a modeled cockpit view, the ones that do have, don't have glass...
I know it could be faked, but the whole point of a modeled cockpit is so you can move the camera around
Feel free to write a fresnel reflection shader then. the reason the glass isnt in the cockpits themselves internally is because it tends to obscure vision like mad. and heaven help you if you tint it :p
Title: Re: Question regarding canopy glass
Post by: Scooby_Doo on January 27, 2013, 06:02:51 am
I tried the reflections once... it didn't work, you got the skybox reflecting rather than the cockpit.
Title: Re: Question regarding canopy glass
Post by: JCDNWarrior on January 27, 2013, 06:31:09 am
This is a good question, since I've seen the cockpits of various fighters in BP for instance I felt bothered that the glass around the cockpit was invisible so it felt like there was nothing protecting me from damage or the vacuum of space. Hope something can be done to fix that.
Title: Re: Question regarding canopy glass
Post by: Kopachris on January 27, 2013, 06:32:37 am
I tried the reflections once... it didn't work, you got the skybox reflecting rather than the cockpit.
Bake an environment map for the cockpit glass and set it up using a shader or script?

To be fair, I have no idea how to do that.
Title: Re: Question regarding canopy glass
Post by: pecenipicek on January 27, 2013, 07:43:41 am
I tried the reflections once... it didn't work, you got the skybox reflecting rather than the cockpit.
Bake an environment map for the cockpit glass and set it up using a shader or script?

To be fair, I have no idea how to do that.
the envmap defines how much of the skybox reflects on which piece of geometry. the envmap is also conveniently located in the alpha channel of the specmap. so you have 256 values per pixel (since its a single channel) and it defines intensity of the reflected skybox.

So, "baking an envmap" is a silly thing to say. one interesting thing that could be done via shaders is diffusing the envmap a bit.

which leads us straight back here (http://www.hard-light.net/forums/index.php?topic=79241.msg1569090#msg1569090)


As a side note, on the general topic of cockpit glass, i believe that you want a 99% transparent glass with specular highlights. which basically means 245-250 in the diffuse's alpha map. or 10-15, depending which end is more transparent. also, tons of polys (well, tons. you want the highlights to move smoothly over em, right?) on the glass is a must if you want it to look decent.
Title: Re: Question regarding canopy glass
Post by: mjn.mixael on January 27, 2013, 08:24:19 am
if you are using the alpha channel on the diffuse, be sure to call it NAME-trans. (shine would be NAME-trans-shine)
Title: Re: Question regarding canopy glass
Post by: Kopachris on January 27, 2013, 08:44:13 am
I tried the reflections once... it didn't work, you got the skybox reflecting rather than the cockpit.
Bake an environment map for the cockpit glass and set it up using a shader or script?

To be fair, I have no idea how to do that.
the envmap defines how much of the skybox reflects on which piece of geometry. the envmap is also conveniently located in the alpha channel of the specmap. so you have 256 values per pixel (since its a single channel) and it defines intensity of the reflected skybox.

So, "baking an envmap" is a silly thing to say. one interesting thing that could be done via shaders is diffusing the envmap a bit.

which leads us straight back here (http://www.hard-light.net/forums/index.php?topic=79241.msg1569090#msg1569090)
The skybox is the environment map (it's a cube-shaped map of the environment).  What I meant by baking an environment map is (as it's described in the link) generating a cube map of the cockpit.  The alpha channel of the shine map isn't an environment map, but maps how intensely the environment map should show (it's an environment map map, or a reflectivity map--they just call it an environment map for convenience).  I guess the current engine doesn't have the ability to use a different environment map on different objects, though.
Title: Re: Question regarding canopy glass
Post by: Nighteyes on January 27, 2013, 11:46:43 am
well, I saw a new(it might have always been there) button in the background editor, named "Environment Map", meaning I assume that I can add my own reflection map to be used instead of the background...
if so, we can use it as a blurry generic starfield, combined with very faint reflections on the cockpit glass... could look decent no? until we get a fresnel reflections glass shader that is :P
Title: Re: Question regarding canopy glass
Post by: Scooby_Doo on January 27, 2013, 02:25:21 pm
Problem is, that reflection would also appear on other ship's surfaces too. It'll appear everywhere.
Title: Re: Question regarding canopy glass
Post by: Nighteyes on January 27, 2013, 05:46:43 pm
Won't it just appear on ships that their shine map has an alpha channel as well?
Title: Re: Question regarding canopy glass
Post by: mjn.mixael on January 27, 2013, 06:04:06 pm
If you are using the mediavps, that's just about every ship.

It's generally considered good practice for shine maps to include the alpha channel for env mapping... So most modellers and texturers do it.
Title: Re: Question regarding canopy glass
Post by: Nighteyes on January 28, 2013, 08:42:50 am
yes but usually its a very dark alpha so the reflections won't be strong... but I can see the problem here, so the solution would be to create a blurred environment map for every skybox you have, seems kind of hackish :)
Title: Re: Question regarding canopy glass
Post by: redsniper on January 28, 2013, 08:44:32 am
It's generally considered good practice for shine maps to include the alpha channel for env mapping... So most modellers and texturers do it.

And when they don't, you get super shiny glass ships like the Triton used to be. :p
Title: Re: Question regarding canopy glass
Post by: mjn.mixael on January 28, 2013, 09:51:58 am
It's generally considered good practice for shine maps to include the alpha channel for env mapping... So most modellers and texturers do it.

And when they don't, you get super shiny glass ships like the Triton used to be. :p

Indeed.