MX Bikes Official Forum

Mods => Paints => Topic started by: AlexTee on April 19, 2017, 08:53:59 PM

Title: normal maps
Post by: AlexTee on April 19, 2017, 08:53:59 PM
sorry for the topic but i cant find any answers on saving normal maps. i noticed in every helmet folder the paints are just named skin.pnt
but how do you save a normal map?
any help would be much appreciated.
Title: Re: normal maps
Post by: 𝖙𝖋𝖈 on April 19, 2017, 09:26:20 PM
http://docs.piboso.com/wiki/index.php/Track_Creation_Rules

I know it says 'track creation rules' but the principal is the same..

Scroll down to the part titled 'Shaders' and read that.

Basically, before running your helmet through fbx2edf, add a text file with the same name as your texture for example helmet.tga would use helmet.shd. put the norm in the same folder and update the file name in the shd. Then run fbx2edf and it should be included.
Title: Re: normal maps
Post by: AlexTee on April 19, 2017, 09:51:04 PM
h o l y fuck.
so extreme just for a normal map though?
ill pass on that lol
Title: Re: normal maps
Post by: Vortex_Damien on April 19, 2017, 09:54:51 PM
its not that complicated ;)
Title: Re: normal maps
Post by: AlexTee on April 19, 2017, 09:56:25 PM
it is compared to naming something skin_norm haha
is there really no other way?
Title: Re: normal maps
Post by: Vortex_Damien on April 19, 2017, 10:41:41 PM
Look at the link tfc provided, name it the same as your default skin
but yes name it like bike_n.tga
the .shd he is talking about is a notepad ++ file that you save as bike.shd
Title: Re: normal maps
Post by: 𝖙𝖋𝖈 on April 19, 2017, 11:31:13 PM
Notepad++, notepad, it's just a TXT file. It's really easy..

You're used to MX sim so I understand it's totally different, but people here are generally pretty helpful. All most people ask is that you read whatever documentation there is.

Hell I wish there were guys around to ask like there are now back in beta 1/2 when we had to figure it all out for the first time ;D
Title: Re: normal maps
Post by: AlexTee on April 19, 2017, 11:39:43 PM
yeah im a total noob at this and feel bad for asking about everything but i just wanna get into it. i always try to dig around and read as much as i can but ive read that link 50 times and dont even know where to start. when i do it once ill be fine but without being able to see an example its hard to understand. and yeah i use notepad++ a whole lot when i do tracks for sim but i just cant wrap my brain around this lol. i just need to see an example i guess. much appreciate the replys/help from everyone
Title: Re: normal maps
Post by: 𝖙𝖋𝖈 on April 19, 2017, 11:42:02 PM
Normals are handled the same on tracks and bikes. Download the example track and you should have your example ;)
Title: Re: normal maps
Post by: AlexTee on April 20, 2017, 04:02:22 AM
so i save the textures as pnt files.
but for the code i just leave it like this? (for a helmet)

bump
{
map = normal_map.tga
}
specular
{       
shininess = 6
}

or do i rename the 'normal_map.tga' as helmet_n.pnt?
???
Title: Re: normal maps
Post by: Vortex_Damien on April 20, 2017, 05:47:08 AM
you want your textures to be .tga format aswell,  bump = normal map
Title: Re: normal maps
Post by: 𝖙𝖋𝖈 on April 20, 2017, 08:29:50 AM
This is all done before the pnt is made. All in one folder I.e helmet/

Step 1, get your texture I.e helmet.tga

Step 2, get your normal I.e helmet_n.tga

Step 3, make a text file. Change its name to the name of your texture and rename the extension to SHD, I.e helmet.shd.

Step 4, tell the shd what normal to use I.e:

bump
{
map = helmet_n.tga
}
specular
{       
shininess = 6
}

Step 5, compile your PNT file.

Step 5 for you could also be running fbx2edf, since your model will then use these textures as the base.
Title: Re: normal maps
Post by: AlexTee on April 20, 2017, 12:05:12 PM
(https://s3.postimg.org/v48wb42xf/bnvmhv.png)

and i have a pnt in the paints. but even when i open up the game it doesnt read the helmet skin. its just empty. also cant see the helmet
idk
Title: Re: normal maps
Post by: 𝖙𝖋𝖈 on April 20, 2017, 12:20:57 PM
If you can't see the helmet in game, how do you know it's not loading the skin?

Is the helmet at the origin in Blender? The origin serves as the connection point between the helmet and the body. From the screenshot you posted, it's at the center of the 3d cursor but not the origin of the world. Obviously not sure what your project looks like but that's the first thing to check.

Also, is the helmet real world scale? For example, if you check the scale in Blender and find out the 3d model is only 3 inches x 3 inches, that's how big it will be in game.

If you've only included the paint when packing the model for the first time through fbx2edf, the base helmet paint wont show up as a PNT in terms of being able to select it from the bike choose screen, to see paints there you will need to create specific paints and put them in the Helmets > Yourhelmet > Paints folder.

Patience mate, it all makes sense, you can't expect to know it all from the get go.
Title: Re: normal maps
Post by: AlexTee on April 20, 2017, 12:34:31 PM
i just thought the pnt would atleast show up in the helmet paint in the bike menu is what i meant sorry.
i actually didnt even think about the scale being different to mxs. probably completely off?

(https://s23.postimg.org/p1o8v47d7/vncfgnf.png)

only ever had to deal with scale being 1.0
is it different for mxb?
(thanks for the replys)
Title: Re: normal maps
Post by: 𝖙𝖋𝖈 on April 20, 2017, 12:41:43 PM
I have no idea, you can't tell unless you change from Blender units to metric or imperial under the 'SCENE' tab > 'units'.

MXB uses real world units of measurement, for example a foot in Blender is a foot in MXB. I've heard somewhere that 1 Blender unit is 1 meter, how true that is I don't know but if it is, that's one massive helmet.
Title: Re: normal maps
Post by: AlexTee on April 20, 2017, 01:02:53 PM
yeah it would be 0.1 in metric im guessing. im confused when i look at the other helmet folders though. all i see is edf file camra file then paints folder. no tga files. in any of them. i put it in metric and still doesnt work.
is there any info anywhere on what the scale should be etc?

Title: Re: normal maps
Post by: 𝖙𝖋𝖈 on April 20, 2017, 01:13:22 PM
Gonna use bold to highlight the important bits.

Yes there is info on scale, like I just said, real world. This means if the helmet is 40 inches deep, 25 inches wide and 30 inches tall (example, not accurate at all), make it that size in Blender.

You don't need TGA's in the final folder.. I think you need to go back and read some of the posts where people have been trying to help you. Take things one step at a time.

You have a base folder which can be anywhere, on your desktop, whatever. You use it to put all the pieces in before compiling (fbx, textures, shd files etc..)

When you run FBX2EDF, it packs the FBX, the SHD file and any textures into one EDF file.

Take any custom helmet folder from the MX Bikes > Helmets directory, or unpack the original helmet folder from the rider.pkz, and replace their helmet.edf with your helmet.edf.

Update any instances of a name in your newly copied folder and replace that name with whatever you want to call the helmet. Remember names and references can be found in GFX files, CFG files, Camera files etc, so go through one file at a time and replace names.

Again, it's a beta. I've seen talk of improving the modding tools for the final release, for now this is as good as we have. It's really not that hard though..
Title: Re: normal maps
Post by: AlexTee on April 20, 2017, 02:26:01 PM
ive gone back endless times and tryed this over and over step by step i just dont know why its not working. spent more time trying to get it in game that i have making the helmet almost lol. rip
Title: Re: normal maps
Post by: Vortex_Damien on April 20, 2017, 04:00:57 PM
For your export i assume your using blender
set origin of the helmet to 0,0,0
apply scale and rotation
in your project folder add your maps and apply the diffuse only in blender
add the .shd file that you create in that folder along with all your maps
now open fbx2edf
set mesh
recalculate ( use smoothing groups )
save your .edf file
Should work just fine, make sure in your files that you define what ever you called the .edf
Title: Re: normal maps
Post by: BadStar on April 21, 2017, 02:07:08 AM
Quote from: AlexTee on April 20, 2017, 02:26:01 PM
ive gone back endless times and tryed this over and over step by step i just dont know why its not working. spent more time trying to get it in game that i have making the helmet almost lol. rip

This happened to me with making tracks.. my head almost fell off.  Once I got it, it was easy as eating cake!   So just stick with it, sounds like you will be a great addition (content creator) to this sim!
Title: Re: normal maps
Post by: Ruubs on April 21, 2017, 10:24:48 AM
Quote from: geofanatec on April 21, 2017, 02:14:27 AM
Oh man do I ever remember the days TFC and me had to figure this out.

I remember sandbiter and beardedforglory too (where did he go?)
In the end it was lots of fun to figure it all out though! Especially normal maps, because tracks started to look great with them.

I've no idea where he is. I thought he didn't like Mx Bikes as much as we do, but I haven't seen him on Mx Sim in a while either.
Title: Re: normal maps
Post by: Alex on April 21, 2017, 03:40:21 PM
ive got it showing up in game. but the normals dont show and the paints dont work. i unpacked a fox v4 skin and its 4mb. but when i save my pngs as tga files they are both 32mb each which is strange.
also i notices the materials dont work. like having the lens shiny etc.
Title: Re: normal maps
Post by: Ruubs on April 21, 2017, 04:13:19 PM
Not sure if this is relevant.
Some of the bikes we use have normal problems as well. I tried reimporting the YZ125 skin with norm but kept getting the same issues as the initial release. Then I added a reflection map (yz125_r.tga) and the norm worked how it should.
Title: Re: normal maps
Post by: 𝖙𝖋𝖈 on April 21, 2017, 04:17:00 PM
Your texture must be the same in blender as it is in your helmet folder pre compile. So if it's called helmet.tga it must be the same file from the same place for both as the fbx takes the path with it from blender and calls that same path when you run fbx2edf.

Also, how are you exporting your fbx? The only option you need checked in blender is 'mesh'. You can disable all the other stuff. Also, 'path mode' should be on auto.

If the textures not showing up, neither will the norm.

Just out of curiosity what were you doing wrong before, what stopped you getting it in game?
Title: Re: normal maps
Post by: Alex on April 21, 2017, 04:35:07 PM
hold up. texture in blender? it would be so helpful if someone could show me a helmet in blender ready for export. they needs to be a default one or something so people can see i reckon.
and not sure what you mean how am i exporting my fbx. how is there another way to do that aprt from it being in blender and exporting it to an fbx?
and option i need 'checked' in blender as 'mesh'??? 'path mode' ? please can u show me a screenshot in blender of where this is.
would like to see a helmet in blender ready for export though.
also with materials....is having materials pointless? like having mirror on lens and shit.
and until i put the 'gfx' file in then it showed up.
so just say i want to change a normal map for a bike like add some logos on a seat or do something on the gear. you have to do this whole process again just to get the new norm working?
just seems rediculous.
Title: Re: normal maps
Post by: Alex on April 21, 2017, 05:08:26 PM
Quote from: geofanatec on April 21, 2017, 04:59:55 PM
I am starting to doubt you modeled this? :P



wow.

anyway. if i apply a texture to it in blender. sure it shows up in game but it acts like a material. if i choose i paint it doesnt do anything. nothing changes.
Title: Re: normal maps
Post by: Asdrael on April 21, 2017, 05:12:04 PM
From my little experience in Blender, only the texturing part of the materials function work to export to the game / FBX. You need to then manually build a normal + specular file afterwards, the way TFC says.

So create your material on your mesh in blender by UV wrapping, get the object + texture in game, then worry about normals and speculars.
Title: Re: normal maps
Post by: Alex on April 21, 2017, 05:47:24 PM
geo ofcourse its unwrapped haha how else would i have skinned it and baked norms for it  ???
(its not scaled right and my graphics are in low) but if i add a reflection text file what do i name it. helmet_r.shd?
super shit how you cant export it with mirror set to different materials  :'(

(https://s8.postimg.org/6apdkuq05/b_vbv.png)
(https://s27.postimg.org/6g8m0b1pv/xdfgdgr.png)
Title: Re: normal maps
Post by: Snappe on April 21, 2017, 06:08:14 PM
Quote from: Alex on April 21, 2017, 05:47:24 PM
if i add a reflection text file what do i name it. helmet_r.shd?

No it's one shd file per texture.
For example this would be the contents of your helmet.shd (assuming your texture is called helmet.tga):


specular
{
shininess = 60
}

bump
{
map = helmet_n.tga
}

reflection
{
factormin = 0.2
factormax = 0.5
factorexp = 5
map = helmet_r.tga
}


The specular map goes in the alpha channel of helmet_n.tga
The reflection map goes in the alpha channel of helmet_r.tga
Title: Re: normal maps
Post by: 𝖙𝖋𝖈 on April 21, 2017, 06:31:06 PM
Ok.. Where to start lol..

Uv unwrap and make your texture that way, then add a material to the model, then a texture and pick the texture you made while unwrapping. This ties the material to the model.

When you export as fbx, unless you have a material applied your texture won't be included in the fbx.

The export options I mentioned are part of the options panel you get when you export the fbx.

Paints work differently. You make your paint, run it through PaintEd and save it as a .pnt file. Then you stick it in your helmets paints folder and it should show up in game. You can get the paint tools from www.mx-bikes.com downloads tab.

You can do custom normals in your paint file but you must know the name of the original texture. For example, your helmet has helmet.tga and helmet_n.tga. make a new texture and normal, call them helmet.tga and helmet_n.tga, put them in a folder on their own, run the folder through PaintEd and it will work.

You gotta walk before you can run. You need patience. People have been more than helpful and it feels like you're not listning sometimes ;) but that could be because you need to get used to the way mxb handles content.
Title: Re: normal maps
Post by: Vortex_Damien on April 21, 2017, 07:59:02 PM
We are explaining it the easiest we can, tfc is one the best at getting shit in game, it really isnt that complicated :P.. the export options are to your left when you hit export and are saving the .fbx
Title: Re: normal maps
Post by: Mace-x on April 21, 2017, 09:57:44 PM
this game is a bitch to mod at times  ;D
love it tho! hahaha
Title: Re: normal maps
Post by: 𝖙𝖋𝖈 on April 22, 2017, 02:09:42 AM
I already explained about the paint.. Go back up and read. All models need a base paint, that's what gets exported with blender. Selectable paints are done using PaintEd.
Title: Re: normal maps
Post by: Alex on April 22, 2017, 04:21:39 AM

is it possible to apply mirror to the lense? or is everything done with spec maps in mxb becausei noticed all the helmets the goggles are not to shiny. all spec and gradient work?
Title: Re: normal maps
Post by: 𝖙𝖋𝖈 on April 22, 2017, 10:18:54 AM
I don't know how well it will work, but if you take a look at one of the textures and shd's included with the example track it uses an environment map reflection with a reflection map.

You might need to experiment with the specular level, and the reflection map will want to be pure 100% opacity white for the goggles.

Might work ;) post pictures when you try. Would be interesting to see results whether it works or doesn't.

You might need to ask PiBoSo if this is possible, but you can have mirrors in GPB. See this thread http://forum.piboso.com/index.php?topic=3248.msg52214#msg52214

Might not work in mxb but I don't see why it shouldn't. Usually mxb, gpb and wrs all seem to share the same infrastructure.