project-navigation
Personal tools

Author Topic: Material parameters (to avoid super-shiny textures)  (Read 5334 times)

Offline Sandro

  • Squad Leader
  • ****
  • Posts: 240
  • Maintenance guy for UFO:AI 3D engine
    • View Profile
Material parameters (to avoid super-shiny textures)
« on: May 15, 2011, 12:24:44 am »
As all of you are have noticed, changes in the renderer brought one very unpleasant feature: all textures that do not have material parameters "specular" and "hardness" defined are reflective to the point of oily, or even metallic look.

This is because of fixing the bug which prevented assignment of default material parameters to textures (in most cases), but current default parameters are not good: they are all set to 1.0, which is very shiny. Looks like it would be a good idea to set some different, better material parameters, but since I'm no artist, I want to ask people of arts -- what values are the best ones?

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Material parameters (to avoid super-shiny textures)
« Reply #1 on: May 15, 2011, 12:34:01 am »
This is hard to answer without doing some testing...

Where exactly can we set this default parameter to play around with different values ?

Offline Sandro

  • Squad Leader
  • ****
  • Posts: 240
  • Maintenance guy for UFO:AI 3D engine
    • View Profile
Re: Material parameters (to avoid super-shiny textures)
« Reply #2 on: May 15, 2011, 12:40:47 am »
Simplest method would be to edit the .mat file. On the other hand, there are r_specular and r_hardness console variables in the game, but they act as multipliers, not the default values. It would be possible to change them to be the deafult values, or, even better, introduce a new r_default_specular and r_default_hardness variables.

Edit:
I mean, the values in the .mat file just replace the default parameters, so creating them will result in the very same image as by changing the default values. They are treated just the same.
« Last Edit: May 15, 2011, 12:45:34 am by Sandro »

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Material parameters (to avoid super-shiny textures)
« Reply #3 on: May 15, 2011, 01:04:02 am »
Editing the .mat file would mean to edit it for each texture separately afaik, that is why I was asking...

I vote for the new r_default_specular & r_default_hardness variables, which then can be overridden for defined textures via material system.

AFAIR Arisian did some coding on this issue & the maximum value was set to 1.0 then: (http://ufoai.ninex.info/forum/index.php?topic=3181.msg38560#msg38560)

Offline Sandro

  • Squad Leader
  • ****
  • Posts: 240
  • Maintenance guy for UFO:AI 3D engine
    • View Profile
Re: Material parameters (to avoid super-shiny textures)
« Reply #4 on: May 15, 2011, 01:56:14 am »
Editing the .mat file would mean to edit it for each texture separately afaik, that is why I was asking...

Sure, but that will be needed only for testing stage -- when good default values will be found, they will be hardcoded into game.

I vote for the new r_default_specular & r_default_hardness variables, which then can be overridden for defined textures via material system.

If my amount of free time allows will code those vars, then.

AFAIR Arisian did some coding on this issue & the maximum value was set to 1.0 then: (http://ufoai.ninex.info/forum/index.php?topic=3181.msg38560#msg38560)

Thanks, read the whole thread. It explains how all that default material values mess did happen :)

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Material parameters (to avoid super-shiny textures)
« Reply #5 on: May 17, 2011, 12:22:05 am »
In my opinion, default behaviour for textures should be not shiny. If a mapper wants shiny textures, they should have to change it.

I find I use low values around 0.1 for matte textures and only bump it up some for very shiny textures. I'm happy for 0.1 to be default. You can look at alienb2.mat as my most-thoroughly-experimented material file for specular/hardness/bump/parallax values.
« Last Edit: May 17, 2011, 12:43:41 am by H-Hour »

Offline Sandro

  • Squad Leader
  • ****
  • Posts: 240
  • Maintenance guy for UFO:AI 3D engine
    • View Profile
Re: Material parameters (to avoid super-shiny textures)
« Reply #6 on: June 11, 2011, 05:18:22 pm »
Just for everyone to know, r_default_specular and r_default_hardness console vars are already available. For a week in fact :)

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Material parameters (to avoid super-shiny textures)
« Reply #7 on: August 10, 2011, 01:17:43 am »
The defaults are now 0.2 for both of them.