STEAM GROUP
Blender Tutorial Community BlenderTuts
STEAM GROUP
Blender Tutorial Community BlenderTuts
24
IN-GAME
220
ONLINE
Founded
October 16, 2012
Language
English
Location
United States 
Smoothing/lighting error
I'm making a replacement for the engineer's pistol that has a cylindrical body. When I load the weapon intot he test map, it has strange black "shadow" lines that stretch along the cylinder, and the lighting in general is just messed up ( http://i.imgur.com/LhZLjh1.jpg ). At first we thought it was a modeling error, we used the Edge Split modifier to separate the cylinder from the front and back, then we tried further triangulating the cylinder's faces. No difference, actually it looked worse after triangulating.

This led me to believe that is was actually a lighting error, since the lighting looks very harsh instead of smooth shading. vmt files are still pretty confusing to me beyond linking to the .vtf files, but I know that is what determines how the lighting looks. My .vmt is posted below (the texturing is not yet finished so there is no mention of alphamaps/phongmasks/normals. I know how those work basically, but tips on that are appreciated as well) Can anyone give me some tips on how to improve the lighting on my model? Any assistance is greatly appreciated.

"VertexlitGeneric"
{

"$baseTexture" "models/weapons/c_items/(VTF_NAME)"

"$phong" "1"
"$phongexponent" "10"
"$phongboost" "5"
"$lightwarptexture" "models/lightwarps/weapon_lightwarp"
"$phongfresnelranges" "[0.007 0.4 5]"
"$halflambert" "1"


"$rimlight" "1"

"$rimlightexponent" "4"

"$rimlightboost" "2"

}
< >
Showing 1-9 of 9 comments
HellJumper Aug 5, 2014 @ 5:55pm 
I think this might be a model error actually. Try a few things: firstly, make sure there are no double vertices (in edit mode, select everything and press "w" > remove doubles). This might remove any hard edges.

Now test to see if the lighting is caused by smoothing groups by giving your model an edgesplit modifier and setting the edge angle to 30 degrees (don't bother marking sharp edges for now, just use 30 degrees and you should be good). Recompile and check.
CaptainGoodstuff Aug 5, 2014 @ 9:11pm 
Hey, thanks for the reply. We checked for double vertices and used the edgesplit modifier on the entire model, set as you suggested. One problem, after exporting and recompiling, the model appears to be using flat shading in-game. We doublechecked that blender had it set to smooth shading and recompiled, no difference. Here's a picture: http://i.imgur.com/8TjoJ2r.jpg

The problem may have ben fixed if I can get it out of flatshading, ha. Any idea?
HellJumper Aug 5, 2014 @ 9:23pm 
Well I had you do that originally to make sure it wasn't a texture problem (which it doesn't look like it is). So now that you know, you should make sure the entire model is using smooth lighting (do this from object mode), then uncheck the 30 degree box for the edgesplit and manually add in sharp edges to your model where you think they should be.
CaptainGoodstuff Aug 5, 2014 @ 9:33pm 
Thanks for the quick response. I have one question: by smooth lighting, do you mean smooth shading, or something different?
HellJumper Aug 5, 2014 @ 9:40pm 
Yup, smooth shading.
CaptainGoodstuff Aug 5, 2014 @ 10:39pm 
Ok, so we undid the edgesplit and marked sharp edges all around the border of the cylinder (and where the fins and other details connect). We then made sure smooth shading was applied and added another edge split modifider, checked sharp edges and unchecked 30 degrees, and recompiled etc. No dice, still flat shading. Are we marking the wrong edges to make sharp or something?
HellJumper Aug 5, 2014 @ 10:51pm 
Try compiling the model with a different .mdl name (or delete old .mdl data before recompiling). Also check it out in the hlmv.
CaptainGoodstuff Aug 5, 2014 @ 11:17pm 
http://i.imgur.com/yYPItPI.jpg

:D

Yup, problem was with the smd. Everytime I export from blender it uses the wrong texture throughout the code, so I would go in NP++ and replace all the incorrect texture names with the right one. Eventually I figured everytime I made a change it would be easier just to go into the previous smd and copy+paste the entire document... genius, I know.

So yeah, thank you so much. The funky reflections should be fixed when we add an alphachannel. Look out for the Sap Zapper on the workshop in the next week ;D
HellJumper Aug 5, 2014 @ 11:22pm 
Awesome!
< >
Showing 1-9 of 9 comments
Per page: 1530 50