Jump to content

Home

Reflective shader?


MightyMidget

Recommended Posts

You need something like the mirror_yavin shader in system.shader. There you can see they map another texture (a simple black color) onto the surface to make it darker. In the mirror_yavin the amount of black depends on the distance between the player and the surface. This is because "alphaGen portal 512". You need "alphaGen const 0.5" for example for your own shader to make it half way black.

 

Of course you can use any floor texture instead of the simple black color if you want. If the value in the alphaGen is higher the the reflectiveness of the surface is smaller.

 

For character I sugges using fake reflections, like newfloor_kej. It uses a texture mapped as an evironment map. It seems it is shiny. I used the same technik to make windows look like they reflecting the sky, however they don't. :)

Link to comment
Share on other sites

how do i apply a mirror? The manual for the editor says just apply the texture and then put a misc_surface_portal at around eye level to the mirrored surface.... but this didn't work... and as a note i'm trying to make a whole floor a mirror would this require a different procedure? Thanks.

Link to comment
Share on other sites

Originally posted by imyourfather

It's always is fake, no game does a real reflection, it will be too heavy.

True. Then let me make myself more clear. When you use a mirror to "reflect" things the engine draws those things twice. When you use a "fake reflection" then you use a pic of the environment on the "reflective" surface to make it look like it is mirroring the environment. Is this better now? :)
Link to comment
Share on other sites

Originally posted by MightyM

how do i apply a mirror? The manual for the editor says just apply the texture and then put a misc_surface_portal at around eye level to the mirrored surface.... but this didn't work... and as a note i'm trying to make a whole floor a mirror would this require a different procedure? Thanks.

 

Theoretically there is no difference. But I dont understand that eye-level thing. As I know the misc_portal_surface has to be not more than 64 units from the surface of the mirror. I can send you a sample map which was designed to show a working camera, but can be used for mirroring without the camera as well.

Link to comment
Share on other sites

I got it now, thanks. I remembered that the demo level had a reflective floor at the end when you get to fight the reborns so i just took it from there... i had to move my misc_portal_surface down to get it to work... so i guess i had it above 64 units.. thanks for your help now i have a shiny floor :)... well as soon as i make my floor texture.

Link to comment
Share on other sites

  • 4 weeks later...

a little trick im using on a map im making is this, make the map, compile it and then take a screenshot of the roof, than take that image, make a floor texture and then turn the floor texture into a shader with the roof image blending in under it with a slight movement value, it looks fecking cool and doesnt hit yur performance as much.

Link to comment
Share on other sites

Originally posted by imyourfather

It's always is fake, no game does a real reflection, it will be too heavy.

 

Eh, that's not true, Q3 has been doing it for the past four years, and other games have before that... What are you talking about?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...