Klems Posted April 29, 2015 Report Posted April 29, 2015 (edited) Added support for Phong on world materials. See Train for examples of such materials. http://www.reddit.com/r/GlobalOffensive/comments/347uvq/counterstrike_global_offensive_update_for_42815/ Just wanted to let you guys know. EDIT: here's the VMT from the modified texture in Train. "LightmappedGeneric" { "$basetexture" "metal/hr_metal/metal_grated_d" "$bumpmap" "metal/hr_metal/metal_grated_d_normals" "$surfaceprop" "Metal" "$phong" "1" "$phongexponent" "105.0" "$phongMaskContrastBrightness" "[.5 8]" "$phongAmount" "[4 4 4 1.0]" "$normalmapalphaenvmapmask" "1" //"$envmap" "env_cubemap" //"$envmaptint" "[.3 .3 .3]" "$detail" "detaildetailconcrete001a" "$detailscale" "[4 4 4]" "$detailblendfactor" "1" } I have no idea what "phongAmount" or "phongMaskContrastBrightness" stands for. Hopefully we'll get some doc soon. Edited April 29, 2015 by Klems will2k, spence, Minos and 2 others 5 Quote
LATTEH Posted April 29, 2015 Report Posted April 29, 2015 (edited) This is something I've been wanting for a long time!Edit: aww you can't use world reflections (env map) with phong. Edited April 29, 2015 by LATTEH leplubodeslapin 1 Quote
leplubodeslapin Posted April 29, 2015 Report Posted April 29, 2015 That's so great !!! So at first i tried to use their texture in a very simple test map with 1 light. It didn't work : screenshot Then i tried to add a sun light, just like in de_train : It worked : screenshot 1, screenshot 2 Then i tried with a custom texture of my friend Wenceslas : it's pretty nice : screenshot 1, screenshot 2 I noticed that the alpha mask that was in the normalmap was used for the phong, the marble reflected more than the wood which is pretty nice. After that, i tried to use it on a displacement : Yeah it works ! screenshot Then i tried to add the world reflections with cubemaps and it works great as well for me screenshot So i don't know what's not working with you LATTEH, can you explain me a bit more ? And finaly the most crazy test : displacement with a texture with transparency, phong, normalmap and specular With $translucent : http://i.imgur.com/5AjUwVz.jpg With $alphatest : http://i.imgur.com/KxEMVks.jpg(even better since you have the shadows and the edges are sharper, more defined than with $translucent) I'll try the other parameters tomorow, i have to go to bed it's late here ^^ Thank you valve guys spence, Deathy, jackophant and 6 others 9 Quote
nicoreda Posted April 29, 2015 Report Posted April 29, 2015 (edited) New test: 1 bumpmap http://images.akamai.steamusercontent.com/ugc/714162056290379890/5A0F3D3C0D1050F8888FB8E6C8AE1BE7E947A309/ 2 Bumpmap http://images.akamai.steamusercontent.com/ugc/714162056290380096/00A866F8958ED1DC997C9F3FE89618099EA632BD/ 2 Bumpmap Lowered the second scale http://images.akamai.steamusercontent.com/ugc/714162056290380218/C50A04F45003921626A5B1A3E89EE1B8AE98537D/ $envmapanisotropy 1 scale 0 http://images.akamai.steamusercontent.com/ugc/714162056290362734/0B0A3C7D5FE7DB80C7A21FEDD47A44D5BE13F5C5/ scale 1 http://images.akamai.steamusercontent.com/ugc/714162056290362934/1E03124D0C4584680403550A528C0A8DE69608EF/ Edited April 29, 2015 by nicoreda jackophant, spence, leplubodeslapin and 1 other 4 Quote
EddieLTU Posted April 29, 2015 Report Posted April 29, 2015 did some tests just a warning, phong and blend textures along with blendmodulade don't like eachother leplubodeslapin, Vaya, nicoreda and 1 other 4 Quote
EddieLTU Posted April 29, 2015 Report Posted April 29, 2015 did a test with a dust 2 tile texture Quote
Skybex Posted April 29, 2015 Report Posted April 29, 2015 $envmapanisotropy 1 scale 0 http://images.akamai.steamusercontent.com/ugc/714162056290362734/0B0A3C7D5FE7DB80C7A21FEDD47A44D5BE13F5C5/ scale 1 http://images.akamai.steamusercontent.com/ugc/714162056290362934/1E03124D0C4584680403550A528C0A8DE69608EF/ How did you get CSGO's tools mode working? I thought it has been broken since release Dosentti and El Moroes 2 Quote
TheGuma Posted April 29, 2015 Report Posted April 29, 2015 Been messing around as well Could do it a bit more subtle, just showing off what a single brush an a texture can do. nicoreda and will2k 2 Quote
nicoreda Posted April 29, 2015 Report Posted April 29, 2015 $envmapanisotropy 1 scale 0 http://images.akamai.steamusercontent.com/ugc/714162056290362734/0B0A3C7D5FE7DB80C7A21FEDD47A44D5BE13F5C5/ scale 1 http://images.akamai.steamusercontent.com/ugc/714162056290362934/1E03124D0C4584680403550A528C0A8DE69608EF/ How did you get CSGO's tools mode working? I thought it has been broken since release add -nop4 before -tools -console and in console, type "toolload vmt" Quote
will2k Posted April 29, 2015 Report Posted April 29, 2015 How did you get CSGO's tools mode working? I thought it has been broken since release 3 years after release, they are still broken But as nico said, you can load all the tools with "toolload" and unload them with "toolunload" (toolload vmt for material editor, toolload pet for particle editor and so on) Thanks everyone who took the time to test this nice feature and post results, much appreciated Quote
Muffin Posted April 29, 2015 Report Posted April 29, 2015 How does phong exactly work and could you give a Noob explanation Quote
Klems Posted April 29, 2015 Author Report Posted April 29, 2015 (edited) How does phong exactly work and could you give a Noob explanation https://developer.valvesoftware.com/wiki/Phong_materials https://en.wikipedia.org/wiki/Phong_reflection_model To put it simply, envmap reflect world, while phong reflect lights. You don't need cubemaps to use phong, so there's no artifacts related to cubemap resolution. The reflection is pixel perfect. I know world is essentialy light and lights are actually rendered in cubemaps, but I think you get the point. There's a bit more to it, phong shading is per-pixel lighting, goureaud is per-vertex, and flat is per-triangle. I'm not sure how source handle models lighting. I guess phong is used if you put $phong in the VMT, otherwise goureaud is set by default. World surfaces are not lit per-pixel, or even per-vertex, because they use lightmaps. Only the reflections matters here. Edited April 29, 2015 by Klems Quote
TheGuma Posted April 29, 2015 Report Posted April 29, 2015 How does phong exactly work and could you give a Noob explanation https://developer.valvesoftware.com/wiki/Phong_materials https://en.wikipedia.org/wiki/Phong_reflection_model To put it simply, envmap reflect world, while phong reflect lights. You don't need cubemaps to use phong, so there's no artifacts related to cubemap resolution. The reflection is pixel perfect. I know world is essentialy light and lights are actually rendered in cubemaps, but I think you get the point. There's a bit more to it, phong shading is per-pixel lighting. Goureaud shading is per-vertex and is used on prop_static. I'm not sure how source handle dynamic models. I know world is essentialy light and lights are actually rendered in cubemaps Correct me if I'm wrong, but I think the world lights are rendered in lightmaps? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.