Game Development Community

Materials are not fully networked

by Stefan Lundmark · in Torque Game Engine Advanced · 06/04/2006 (7:51 am) · 8 replies

As the title says, materials do not transfer fully over the network.

For instance, say you apply a texture to your model in 3D Studio Max, and the filename is MaxTexture.png. You remap the texture in your shader, but to a filename ShaderTexture.png.

When you run a listen server, the texture will be visible as expected. But when a client connects, it will be told to validate the texture, but not ShaderTexture.png, instead it tries to verify the MaxTexture.png and fails because it does not exist.. and you end up with a white texture. Wohoo!

Next is that if you do use the MaxTexture.png to workaround the issue, the specular map is not used on connecting clients, only the server.

Is this known? Didn't see it in the forums before.

#1
06/04/2006 (9:32 am)
Materials were moved to be client side required a while back because they were causing such huge load times, so by default they aren't going to be transmitted at all as far as I am aware.

It does sound like there is some form of an issue here though, I'll refer to Brian.

Edit: can you duplicate this if all appropriate files exist on the client prior to connection to the server?
#2
06/04/2006 (9:58 am)
Quote:
It does sound like there is some form of an issue here though, I'll refer to Brian.

Thanks!

Quote:
Edit: can you duplicate this if all appropriate files exist on the client prior to connection to the server?

Yup. The client installation is identical to the server installation, just different machines.
It shouldn't be too hard, probably just something from old TGE where it looks in the .dts for the texture's filename, rather than in the material.

However, I do not have any knowledge of the interals regarding this so I cannot help much.

Edit: "rather than"
#3
06/07/2006 (12:07 pm)
Hey Stephan, this behavior is known, I guess I figured if you were referencing the texture in the DTS, you'd have it around on disk as well. I'm not crazy about validation on Materials though, so I'll have to think that one over.

For now, make sure that textures referenced from .dts files exist.

Not sure what's going on with the missing specular, especially if it works on a localhost situation. Most likely the client does not have the same Material or textures as the server. I know this is supposed to work, and I've tested it many times on my own project which uses a dedicated server without any problems. Does everything but the specular work? Bumpmap and lighting work OK?
#4
06/08/2006 (1:29 am)
Quote:
Hey Stephan, this behavior is known, I guess I figured if you were referencing the texture in the DTS, you'd have it around on disk as well.

I'm not crazy about validation on Materials though, so I'll have to think that one over.
For now, make sure that textures referenced from .dts files exist.

Hello Brian. So what you're saying is that:

1. You have to reference a texture in the .dts or you won't be able to map a material to your model.
2. The texture referenced in the .dts have to exist eventho it's not being used as soon as you map your baseTexture[0] to it.

You don't see a problem with that? :) Waste of space and confusing. Why not keep it the same everywhere?

I guess the solution is to use the same texture for the .dts and the baseTexture[0] - but then what's the point with the option to remap.

Quote:
Does everything but the specular work? Bumpmap and lighting work OK?

No, nothing work. Not even lighting. The client and server are the same, just one connects and one serves.

Edit: Cleaned up.
#5
06/08/2006 (1:40 am)
Edit:

Please ignore this thread, it was once again my ability to think that was at fault.
Renaming the materials.cs to material.cs was my mistake and I didn't think loadMaterial was looking for that particular name.

My apologies, and sorry for wasting your time Brian.
#6
06/08/2006 (7:30 am)
Ahh--I missed that my self--while convienent if you know the naming convention, it can slide by you since it -is- a change.

For those reading: TSE will now pickup any materials definition in any script file named materials.cs (or materials.cs.dso), anywhere in your data directory, but it is looking for one (or more) file(s) with that exact name.
#7
06/09/2006 (9:34 pm)
No problem Stefan, glad you found the problem. With the coming update, those unmapped materials will appear bright orange with "no material" written on it, so this type of thing will be easier to identify.
#8
06/04/2010 (3:04 pm)
Stephen, It doesn't make sense to send TEXTURE data across a network, but it makes a ton of sense to send MATERIAL data across a network. Which doesn't seem to be possible. Big problem... how can I send dynamically changing material props across a network?