Author Topic: Environment maps with hues  (Read 2106 times)

0 Members and 2 Guests are viewing this topic.

Offline Kolgena

  • 211
Environment maps with hues
I was wondering how easy it would be to add a feature to env mapping, namely, the ability to reference the spec map when drawing the env map. Currently, a gold (or any other colored) object will have env reflections that assume the model is silver/mirrored, which can sometimes be unconvincing in appearance. If the env map could somehow reference the spec map's color, or exist outside of greyscale values, could it look better? In this way, shiny mirror ships may look more like polished reflective metal, rather than something coated in lacquer.

This image demonstrates what I meant by how reflections take on a tint based on the material they reflect from.


Think this is worth the time/effort? It seems like it could be as simple as env output * spec map, which substitutes the old env output, but I could be totally off too. I also realize that this suggestion fits in better with the materials system that will be coming some point in the future, but if it actually is easy to implement, it might be a nice addition to the shaders.

 

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
Re: Environment maps with hues
It seems like it could be as simple as env output * spec map, which substitutes the old env output, but I could be totally off too.

Actually that is already in you just have to make the Spec map without an Alpha channel. As you can see in this bit from the Shaders:

Code: [Select]
#ifdef FLAG_ENV_MAP
   vec3 envIntensity = (alpha_spec) ? vec3(specColour.a) : specColour.rgb;
   fragmentColor.a += (dot(envColour.rgb, envColour.rgb) * ENV_ALPHA_FACTOR);
   fragmentColor.rgb += envColour.rgb * envIntensity;
 #endif
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline Kolgena

  • 211
Re: Environment maps with hues
Cool. Is that in the shaders for deferred lighing only, or in the old ones too? I might have missed the behavior because my laptop is too crap to run the deferred lighting stuff.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Environment maps with hues
This is the same for all shaders.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: Environment maps with hues
interesting historical note: the original implementation actually worked only like this.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

  

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Environment maps with hues
This sounds related to the 'everything is covered in stars' issue we used to have.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays