Source SDK

Source SDK

Chrome or chromeish material using Phong shading?
Hi,

I have been trying for some time now to create a chrome type effect using Phong shading parameters for a project, however I've been unable to obtain the right appearance, despite playing with a large amount of VMT commands and combinations. I know Phong shading will not give static reflections and will likely look inferior to an envmap based texture, but for reasons stated below I have no choice but to use Phong and avoid envmaps.

I had originally used an envmap based texture with inverted speculars in the alpha channels of the normal maps and got the exact effect I desired, however it did not support multiple lighting conditions, by that I mean the reflections remained "Lit" when lights were toggled. For quality control reasons this side effect was unacceptable as the amount of content using reflections meant that the project suffered major visual artifacts.

Phong shading seems to be the answer to this problem, as it generates faux reflections that respond properly in differing lighting conditions, as in not having reflections in unlit conditions, and generating reflections when in contact with light sources.

I'd appreciate help with creating this material, I have knowledge of basically all VMT commands, different texture map types etc. so feel free to jump right in to the core things.

If you need any further information, such as screenshots of the problem specifically, just ask.

Thanks in advance.

Last edited by ◮⩂∮⍖⊒⏃⫶⎬≡⩃; Mar 27, 2015 @ 11:48pm
< >
Showing 1-7 of 7 comments
Dmitriy Mar 28, 2015 @ 12:39am 
yeah, would be good to see screenshots
I'll send a friend request, It'd be far easier to explain all of this in chat than on this forum.
Last edited by ◮⩂∮⍖⊒⏃⫶⎬≡⩃; Mar 29, 2015 @ 7:41am
Dmitriy Mar 29, 2015 @ 6:57am 
I think it'd be better to keep this discussion on forums. Just post screenshots, name the game you're modding. And may be we'll find solution
Alright, let me try and explain it.

I need a chrome material (Looks extremely reflective, no matte areas, metallic) that ONLY uses Phong as a base, no Envmap commands. The reason is stated below.

Any material using Envmap commands relies on cubemaps for reflections, this leads to a couple of problems.

The first problem is that it cannot handle multiple lighting conditions. if I wanted a room with 2 lighting states, as in On and Off via a lightswitch for example, the envmap reflections will only be present in the initial state that the map is compiled in.

If the room is compiled with the lights on, the reflections will be present, but will NOT change when the lighting state is switched to off. (They will remain "Lit" as if the lights were still on)

If I do the opposite and compile with lighting off, there will be no reflections, but none will be generated when the light is switched on.

I had a full page of information in a Notepad ++ file I created to explain, and screenshots.

I'll post the link to the screenshots.

http://imgur.com/a/5cj6B#10

Phong shading acts very differently to Envmap based materials, as it can respond to differing lighting states, the reflections it create are not very realistic, but it's the neccessary option. I've had a lot of trouble even creating metallic looking Phong materials, since by default it gives a very plastic, rubbery look.

The screenshots are not my assets, they were all taken from multiplayer, but they show off quite well what the problems are.

Most of the assets, apart from the blue cube, are Envmap based.

The blue cube is Phong based, the light next to it was created in realtime in-game (Garry's Mod) to show that it reacts appropriately.

This project uses a very large map, and the secondary "Off" lighting state effects all of it, it has to be complete darkness with no visual lighting problems. Just so we're clear that it has to not contain Envmap code.

This is for Garry's Mod.
Last edited by ◮⩂∮⍖⊒⏃⫶⎬≡⩃; Mar 29, 2015 @ 7:32am
Dmitriy Mar 29, 2015 @ 7:49am 
- first thing I thought is to turn off reflections on an entity entirely when the room is fully dark.
- next thing I thought is to look at env_cubemap code and see how it works, may be you can swap cubemaps in realtime. E.g. when room gets darker you use darker cubemaps.
This can be done only if you have access to the source code of a game you're working on.

Another approach is to find similar thing is some other map/sourcegame and use their technique.
Dmitriy Mar 29, 2015 @ 7:51am 
one more option would be to write your own shader
I could probably get something desirable by messing around more with Phong commands in the VMT, if you do have any ideas about using Phong, Fresnel ranges or RImlight commands it would be good.
Last edited by ◮⩂∮⍖⊒⏃⫶⎬≡⩃; Mar 29, 2015 @ 8:54am
< >
Showing 1-7 of 7 comments
Per page: 1530 50