project-navigation
Personal tools

Author Topic: Textures  (Read 34746 times)

Offline Voller

  • Squad Leader
  • ****
  • Posts: 104
    • View Profile
Re: Textures
« Reply #45 on: May 17, 2010, 05:38:59 pm »
Code: [Select]
#define DEFAULT_SPECULAR 1.0
...
#define DEFAULT_GLOWSCALE 1.0

Does that mean things are fully glossy and also glowing by default?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Textures
« Reply #46 on: May 17, 2010, 05:43:54 pm »
yes - but if you see a problem with it, tell me better default values - the problem is that we don't have many textures/maps that are using these - so it's hard to determine sane default values.

Offline Voller

  • Squad Leader
  • ****
  • Posts: 104
    • View Profile
Re: Textures
« Reply #47 on: May 17, 2010, 08:00:28 pm »
Still not sure if I understand it, sorry :-\

Does a mapper have to specify that a normal/specular/etc. map should be used, or will the engine automatically load the respective maps if they exist?

If it's the former, then it doesn't matter so much, because the mapper will not load the default values if they don't fit.
If it's the latter I'd suggest you at least switch off the glow  ;D

So in that sense, I guess I have answered my question myself. Or else you would be getting lots of complaints that everything is glowing bright white... ::)

Still, maybe a default specular map of 0.5 or even less would be more appropriate. That way you can use the default for pretty much anything unless a specific specular map exists.

Unfortunately my graphics card doesn't seem to support these kinds of effects, otherwise I'd experiment a little myself.

Voller

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Textures
« Reply #48 on: May 17, 2010, 10:10:01 pm »
the normalmaps are loaded automagically ;)

a mapper should provide a material file that defines suitable values for those textures (with a normalmap)

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Textures
« Reply #49 on: May 18, 2010, 12:18:19 am »
Still, maybe a default specular map of 0.5 or even less would be more appropriate. That way you can use the default for pretty much anything unless a specific specular map exists.

Not sure if something's changed recently, but my understanding was that 1.0 does not mean "as much as possible". You can use 2.0 and 3.0, etc., to make the effect greater, and 0.5 to make it smaller. So keeping the default at 1.0 should be fine as long as it's not too exaggerated at that level.

Offline arisian

  • Rookie
  • ***
  • Posts: 91
    • View Profile
Re: Textures
« Reply #50 on: May 18, 2010, 03:22:11 am »
Actually, 1.0 is now super-shiny.  The new specularity-textures need to have values in the range 0-1 (well, 0-255, but that gets mapped to a float in the range 0-1 by your graphics card).  That means that with a texture, 1.0 really would be the maximum reflectivity.  The older system, which stored SPECULAR and HARDNESS values as material parameters, wasn't constrained to the range 0-1, since they could specify floating point values directly in the .mat files, which is why you could use bigger values.  The current "defaults" are actually set in R_EnableDynamicLighting() (because I didn't know about the #defines), and the default values are much lower than 1.0.  SPECULAR or HARDNESS values, if specified, will override the defaults; if a specularity and/or roughness texture is provided, that will override the SPECULAR or HARDNESS values.

Oh, and all the "accessory" textures get loaded automagically; so long as you follow the naming conventions, all you need to do is drop the new textures in with the old ones.  And I'll just mention again here that you don't always need to have all the textures be the same resolution; a 1x1 pixel specularity and/or roughness texture would be perfectly fine for an object that was uniformly shiny over it's surface.

Current defaults (hardcoded) are SPECULAR=0.25, HARDNESS=0.1;  the HARDNESS parameter controls how strongly the material reflects light, and the SPECULAR parameter controls how tightly focused the reflection is (ie. do you get a small "spot" of shine, or does the shine cover a larger area).  SPECULAR = 1.0 would mean a very tiny bright spot.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Textures
« Reply #51 on: May 18, 2010, 08:01:39 am »
it would be nice if you could update the material system page in the wiki with this information - and use the constants (in trunk, too please, i will merge that back in 2.3 [or are you only talking about your recently created real-time-shadow-branch?]) - otherwise it might really look strange ;)

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Textures
« Reply #52 on: May 18, 2010, 09:57:34 am »
Thanks for the info arisian. I'll probably need to take another look at my values with the new system.

Does this mean we can provide a specularity file that makes certain parts of the texture more reflective than others? And is there information somewhere on the format for this?

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Textures
« Reply #53 on: May 18, 2010, 09:58:20 am »
Now I know what was causing my funky gfx, when using the old material files & values like bump 5.0 or specularity 6.0 !

lol.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Textures
« Reply #54 on: May 18, 2010, 09:59:50 am »
@H-Hour: http://ufoai.ninex.info/wiki/index.php/Artwork

arisian updated it some while ago.

Offline MCR

  • PHALANX veteran
  • ******
  • Posts: 1244
    • View Profile
Re: Textures
« Reply #55 on: May 18, 2010, 10:05:31 am »
 ;D

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: Textures
« Reply #56 on: May 18, 2010, 10:59:41 am »
Thanks MCR. I've added a link to that page into the Mapping/Materialsystem page that also talks about bump/parallax/hardness/specular/glowscale.

@arisian, should the text for the general surface parameters at the link above be changed to reflect the new range of 0.0-1.0? And is this true for all the options under General Surface Parameters?

Offline Voller

  • Squad Leader
  • ****
  • Posts: 104
    • View Profile
Re: Textures
« Reply #57 on: May 24, 2010, 09:41:58 pm »
Ok, replacement for floor003, including normal and specular map. The other ones I made because I felt like it; if you can use them, by all means help yourselves.


I also made a specular map for the cloths on the other page. You can't see much cause it has a very low alpha value.



.map files for MaPZone are attached. Also the updated one for the cloths.
« Last Edit: May 24, 2010, 09:43:52 pm by Voller »

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: Textures
« Reply #58 on: May 24, 2010, 11:11:08 pm »
We don't need all those variants, do we? We can just rotate the textures in radiant.

Offline Bartleby

  • Squad Leader
  • ****
  • Posts: 102
    • View Profile
Re: Textures
« Reply #59 on: May 25, 2010, 07:10:31 am »
if u want to use them, u need them..... not they are not the same...