Page 1 of 2

Overgrwoth Custom Weapon Shading

Posted: Wed Nov 16, 2016 2:49 pm
by Blendahead
Hi I am trying to make a spiked baseball bat, but the shading is always messed up, like this...
20161121143714_1.jpg
20161121143714_1.jpg (89.92 KiB) Viewed 12308 times
20161121143712_1.jpg
20161121143710_1.jpg
20161121143706_1.jpg
20161121143706_1.jpg (78.8 KiB) Viewed 12308 times

Re: Overgrwoth Custom Weapon Shading

Posted: Wed Nov 16, 2016 4:04 pm
by Silverfish
What shader are you using and what does your normal map look like? I'm thinking it might be an issue with using a tangent space normal map with the object space normal map shader.

Re: Overgrwoth Custom Weapon Shading

Posted: Wed Nov 16, 2016 4:08 pm
by Blendahead
I am using the typical one, cubemapobjitem
when I use tangent it has no shading at all
and this is my normal map...
Lucile_norm.png

Re: Overgrwoth Custom Weapon Shading

Posted: Wed Nov 16, 2016 4:40 pm
by Silverfish
Ok, that looks good. I would guess that you'll need to swap and/or flip one or two of the channels in your normal map for it to work like it should. Unfortunately I don't know which ones or how and I don't have time to test it out right now myself.

Please let us know if you figure it out!

Re: Overgrwoth Custom Weapon Shading

Posted: Wed Nov 16, 2016 4:44 pm
by Blendahead
Okay will do, thanks for your help

Re: Overgrwoth Custom Weapon Shading

Posted: Wed Nov 16, 2016 5:37 pm
by Blendahead
Does anyone know if there is a way to make it use tangent normals without making it a flat object?

Re: Overgrwoth Custom Weapon Shading

Posted: Thu Nov 17, 2016 6:47 pm
by Silverfish
It doesn't need to be a flat object to use tangent space normals. Tangent space normals just use the normal map in a way that modifies the underlying normal instead of overriding it entirely.

There are some comparison images and more information on the subject here: http://wiki.polycount.com/wiki/Normal_M ... al_Details

To tell the game that you're trying to use a tangent space normal map, use the version of the shader without "obj" in it. So in your case you should use "cubemapitem" instead of "cubemapobjitem".

Re: Overgrwoth Custom Weapon Shading

Posted: Fri Nov 18, 2016 12:57 pm
by Blendahead
When I use a tangent normal map it makes the object look flat even with cubemapitem,
and nothing ever changes when I change the shader name line

Re: Overgrwoth Custom Weapon Shading

Posted: Fri Nov 18, 2016 3:54 pm
by Silverfish
Hh, weird. Would you like to zip up the object.xml file as well as the textures and the model so I can take a look and hopefully figure it out?

Re: Overgrwoth Custom Weapon Shading

Posted: Mon Nov 21, 2016 3:31 pm
by Blendahead
Sorry I just got back to my computer, (I was gone for the weekend), but sure I will be happy to zip it up and send it to you

Re: Overgrwoth Custom Weapon Shading

Posted: Mon Nov 21, 2016 3:36 pm
by Blendahead
Here it is
Lucille.zip
(805.38 KiB) Downloaded 406 times

Re: Overgrwoth Custom Weapon Shading

Posted: Tue Nov 22, 2016 5:23 pm
by Silverfish
I tested some things with it and had to ask the rest of the team because I couldn't get it to work either. Apparently it's no longer the "cubemapitem" shader you should use if you want to use a tangent space normal map on an item, but simply the "cubemap" shader.

EDIT1:
I updated the wiki with this information.

Re: Overgrwoth Custom Weapon Shading

Posted: Tue Nov 22, 2016 6:07 pm
by Blendahead
Okay thanks! I'll try that

Re: Overgrwoth Custom Weapon Shading

Posted: Tue Nov 22, 2016 6:17 pm
by Blendahead
So I did that and now there is definitely shading but it has this strange thing where the whole model lights up and darkens depending on the angle of view...
20161122151309_1.jpg
20161122151309_1.jpg (41.22 KiB) Viewed 12279 times
20161122151308_1.jpg
20161122151308_1.jpg (63.46 KiB) Viewed 12279 times
20161122151305_1.jpg
20161122151305_1.jpg (61.56 KiB) Viewed 12279 times
20161122151303_1.jpg
20161122151303_1.jpg (61.72 KiB) Viewed 12279 times

Re: Overgrwoth Custom Weapon Shading

Posted: Wed Nov 23, 2016 5:16 pm
by Silverfish
So you changed it to use the cubemap shader, right? Did you also replace your object space normal map with a tangent space normal map?

If you just want to test the shader with a flat normal map, there is a flat normal map called "blank_TS_white_n.tga" right in the ../Overgrowth/Data/Textures/ folder.