Page 1 of 1

Cubemap vs phong shading.

PostPosted: Sat Nov 23, 2013 8:43 am
by oOCaptainCrazyOo
So for static props such as a safe and such, what would be better to use? Phong shading or env_cubemap? I remember using phong shading years ago when messing around with walls and such but for something like a prop which would be better? For now I'm only going to be using it for props and not weapons so it's not an issue as of yet but I'd really like to familiarize myself with it again/

Also could somebody remind me of what the console command is to "see" its effects in the game? I've tried looking through pages of search results on Google but can't seem to find anything and i only ask on a forum as a last resort.

Thanks!

Re: Cubemap vs phong shading.

PostPosted: Sat Nov 23, 2013 9:56 am
by Sathor
Really depends how well you execute the masks, tbh. Both can look very good for smaller objects. For a metal object like a safe with mostly sharp corners, I'd prefer cubemaps...

But without the right masking, both won't look good. Phong tends to add a plastic-look if not used correctly.

Re: Cubemap vs phong shading.

PostPosted: Sat Nov 23, 2013 10:42 am
by oOCaptainCrazyOo
Sathor wrote:Really depends how well you execute the masks, tbh. Both can look very good for smaller objects. For a metal object like a safe with mostly sharp corners, I'd prefer cubemaps...

But without the right masking, both won't look good. Phong tends to add a plastic-look if not used correctly.


Thanks i know all about masking and such as I've done it before :D In something like GMod will i need to run a command line each time i put an object down? I'm guessing I'll also need an env cube next to it to make it work though right?

Re: Cubemap vs phong shading.

PostPosted: Sun Nov 24, 2013 4:55 am
by jimonions
the cubemaps are placed in the map editor and compiled there. The buildcubemaps command is run once ingame to build them after which they are automatically attributed to that map. Any models using a cubemap shader will look for the nearest cubemap and use it.

Re: Cubemap vs phong shading.

PostPosted: Sun Nov 24, 2013 9:08 am
by SotaPoika
jimonions wrote:the cubemaps are placed in the map editor and compiled there. The buildcubemaps command is run once ingame to build them after which they are automatically attributed to that map. Any models using a cubemap shader will look for the nearest cubemap and use it.


Isn't it twice? Once for LDR and once for HDR.

Re: Cubemap vs phong shading.

PostPosted: Sun Nov 24, 2013 9:26 am
by Dives
if you use -both. Not even worth it to use -both because but who has a computer that can't run HDR in 2013?

Re: Cubemap vs phong shading.

PostPosted: Sun Nov 24, 2013 10:06 am
by oOCaptainCrazyOo
Thanks for all of the insightful info and tips, now i need to find a tutorial to brush up on making one but i doubt that's hard.

Re: Cubemap vs phong shading.

PostPosted: Sun Nov 24, 2013 11:29 am
by kraid
You're question implies that you have to use either envmap or phong.
These two are a completly different effect and can be used at the same model if neccessary.
Phong isn't there for creating reflections, it just has an impact on highlights and general light distribution arround a model. It alters the material appeareance. (even to a point where toon shading ala TF2 is rendered)
Envmap on the other hand is used to create the reflections on the surface of a prop.

While it's true that some envmap parameters don't work if you're using phong, it's still there to cause reflections.
So the question if you should use envmap, phong or both on the prop simply depends on the model itself (what material appeareance to achive) and overal performance.

After all, an important prop or even character will use both in combination with a phongmask and an enviroment mask that was put into the normalmaps alphachannel.
So there are quite a few textures to load beside the calculation of the shader.

Re: Cubemap vs phong shading.

PostPosted: Mon Nov 25, 2013 10:07 am
by MrTwoVideoCards
everything in the real world uses both, if you're going for something realistic. Baiscally what kraid said, they are two completely different things, and every object tends to have a specular highlight and an environment reflection unless it's a rough surface thus creating no environment reflection.

Re: Cubemap vs phong shading.

PostPosted: Tue Nov 26, 2013 4:36 am
by Black_Stormy
Unfortunately in source, you can't use both in the same .vmt (please tell me I'm wrong?).

Since we're doing it, which is cheaper to render? Cubemaps or Phong? And what about Rimlight? Usually if I use phong I'll use rimlight purely because it's part of the phong package in source so why not.

Re: Cubemap vs phong shading.

PostPosted: Tue Nov 26, 2013 8:29 am
by WhiteDevil
wut? I made some chrome using both. But I don't recommend it. Spent something over an hour tinkering the settings to get looking even barely similar.
Image

Re: Cubemap vs phong shading.

PostPosted: Tue Nov 26, 2013 12:01 pm
by MrTwoVideoCards
cubemaps are cheaper, also that looks pretty good whitedevil. Chrome has a specular highlight and reflects the scene, not sure why you'd have problems with doing both on the model.

Image

Re: Cubemap vs phong shading.

PostPosted: Wed Nov 27, 2013 4:25 am
by jRocket
I use both. I think they added support for using both with the orangebox engine. I know you couldn't combine phong with cubemapped reflections when phong was introduced with episode one, so there may be some confusion there.

WhiteDevil - is that phong on world brush geometry??

Re: Cubemap vs phong shading.

PostPosted: Wed Nov 27, 2013 5:28 pm
by WhiteDevil
No, phong is a vertex shader so you can't put it on world brushes.