Normal Map not working

GTA:V Modding with ZModeler3 discussion.
Post Reply
shizzyu
Posts: 12
Joined: Fri Jan 22, 2021 10:42 am

Normal Map not working

Post by shizzyu »

I have a piece of clothing and I've made a normal map for it. In zmodeler, it doesn't have any effect, but If I change the material to one that does work (one of the bump materials), my clothing item crashes the game. If I use the ped or ped_cloth material, my clothing works but is flat shaded and the normal map has no effect in game
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Normal Map not working

Post by Oleg »

the "ped_cloth" does have a bump layer in it. What exactly is wrong in the game when you use this shader? It uses UV from UV#1, as well as bump normals are generated from UV#1. Make sure your cloth model is properly mapped in UV#1. Avoid collapsing uv-mapping to a point when you need to paint something to a color of some pixel, it will not generate correct bumpmap then.

Other than that, you can use only ped_cloth shader for cloth-simulated geometry, as this is the only shader with additional math for cloth physics in it.
shizzyu
Posts: 12
Joined: Fri Jan 22, 2021 10:42 am

Re: Normal Map not working

Post by shizzyu »

The UV map is fine, but in game there is no normal detail like there should be. theres no "bump", its just flat
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Normal Map not working

Post by Oleg »

if you attach the cloth model to the regular mesh (to make it non-cloth-simulated) and use "ped_default" or "ped" shader on this geometry, does bump work fine then?

I mean, test your geometry with shaders that support bump-map and check in game. I don't remember cloth shader to use bump-map actually, they generally use fabric detail palette to simulate surface bumpiness.
shizzyu
Posts: 12
Joined: Fri Jan 22, 2021 10:42 am

Re: Normal Map not working

Post by shizzyu »

I actually don't need cloth simulation, but I've tried ped_default and the normal map appears to have no effect in zmodeler or in game. the "ped" shader has the normal map effect in zmodeler, but in game it still has flat shading. If I use any other type of material from zmodeler, the game crashes
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Normal Map not working

Post by Oleg »

normal map will appear in ZModeler if an associated material has Bump in shader (any bump shader). The game shaders you specify (ped, ped_default, ped_cloth) are all allowed to have bumpTexture on them. Once you export and put a model in game, you can check it in OpenIV: "More information" -> "Shaders" -> "ped"... and check whether your texture is actually listed in "bumpTexture".

If you have material exported with your bump texture listed there, then ZModeler created a correct model. The rest of issue is either related to texture itself or the shader in game, make it requires something to do the job properly (e.g. model per-vertices paint can contain some information for the shader code as an example). I have no idea what game's shader code does, I can see only parameters for these shaders that are set for some geometry fragment to be drawn. ZModeler sets these parameters on export.
shizzyu
Posts: 12
Joined: Fri Jan 22, 2021 10:42 am

Re: Normal Map not working

Post by shizzyu »

Yeah it's listed there, I'll take a break from this and give it a try again at a later time as I haven't been able to figure it out for days
Post Reply