Forums

Full Version: Seperate Shaders
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It might be a good idea to have separate shader files for each car. That way all the cars wouldn't have to have the exact same type of reflection, shininess, etc.
It would be but then again it would be a lot of work also Smile Smile Sad Sad
The goal is to have one shader, with per-car or per-pixel parameters that can be set in a car-dependent way. For example, you can already change the per-pixel shininess per car through a glossmap (currently only used on the XS, and it's just full glossy on the metal bits and not glossy on the door/hood seams).
been having an idea for a little while now, and i just got something together for it.

give a car's wheel a regular flat saturation map, and then a very noisy, high-res, specular map. to get a metallic glow effect.

[Image: highresmetallicglow-full;init:.jpg]

here's something i came up with for it. the reason why this seemed an appropriate place to put it is that the specular map had to be very high-res 2048x2048. in fact i think it would only really get the right effect if it were even bigger. or i was using the full 2048 for that part of the wheel. i have a feeling this would be a good approach for lots of rims and even pearl coats. but to do this i think there needs to be a general shader library somewhere that can be called for any vehicle or any track object. this way there could be a single tile-able, super high-res noise map that could be used for anything that has glittery highlights. and it would only take up that 12.5MB of texture memory once.

thinking about the tile-able part: if it could be tile-able 3 ways (so each triangle would get the full texture resolution) that would probably be ideal, could maybe get away with a lower res texture too. actually since it's just a noise texture it might be tile-able 3 ways be default, not quite sure.
Since it's a noise texture it should already tile fine, and in fact you don't need anything very high res for random noise; you just need to scale the UV coordinates down so that a small random noise texture gets repeated a lot. That would require different UV maps for specular maps versus diffuse maps, which currently isn't supported, or custom shader code to automatically scale the UV coordinates. Do you see what I mean about scaling the UV coordinates and using a small texture instead of using a huge texture?
oh yeah, totally. setting the uv coords to something greater than one. didn't think of that. i haven't tried to tile a noise texture before but it does seem like it would work out (hopefully on the diagonal-cata-corner line you wouldn't see any strangeness).

i was sorta thinking, at first to do that test with what already available in code at the moment, and the quickest way i thought of was a way-high res specular map to give an example of what i'm thinking of. and then wanted to see if you (and other programmers) think it'd be a good approach to get that sparkley rim look...also for metallic body colors, and maybe with an rgb specular map pearl coats and flip-flop colors.

if it does sound like a good idea then it could be a type of general purpose shader, that gets applied across a wide range of cars, parts, and tracks.

==
but anyways: i read your post on the front and figure all this stuff is probably back seat to the refactor. let me ask though, if i(we) should post all our big dream-feature requests to the refactor news post. so you can consider the implementation of those for the refactor...or if i(we) should make a forum thread for all that big dream stuff...or if i/we should keep out big mouth(s) shut and let you do your thing.