Mapping Materials
by Rapid Fire · in Torque 3D Professional · 11/23/2009 (7:37 pm) · 5 replies
I'm currently making a custom Projectile Type, and I'm running into issues.
I'm not 100% sure on the workings of the Material system yet. I can edit Mapped Materials, and I can use models whose textures are unmapped an built into the DTS, but I'm not sure how to either take that unregistered texture and turn it into a material, or map an existing unmapped material to an object.
I tried editting the scripts directly, but that was giving me larger errors, and I'm unsure of the naming conventions, my attempts did not work.
The code I attempted to use was:
singleton Material(simpleLaser)
{
mapTo = "cube";
diffuseMap[0] = "redcube";
};
This was to map redcube.jpg to cube.dts. It's already implemented by default inside the DTS file, but I'm trying to add emissive and glow parameters to it. Using this mapping, the simpleLaser material, when editted does not edit my Cube.dts.
Currently simpleLaser can be Emissive, but Glow does not even show up in the editor, and neither effect maps to the in game Laser object.
Is there any location for a Material Editor crash course page or anyone that can give me any hints to getting my own materials mapped and ready for editting within the World Builder?
I'm not 100% sure on the workings of the Material system yet. I can edit Mapped Materials, and I can use models whose textures are unmapped an built into the DTS, but I'm not sure how to either take that unregistered texture and turn it into a material, or map an existing unmapped material to an object.
I tried editting the scripts directly, but that was giving me larger errors, and I'm unsure of the naming conventions, my attempts did not work.
The code I attempted to use was:
singleton Material(simpleLaser)
{
mapTo = "cube";
diffuseMap[0] = "redcube";
};
This was to map redcube.jpg to cube.dts. It's already implemented by default inside the DTS file, but I'm trying to add emissive and glow parameters to it. Using this mapping, the simpleLaser material, when editted does not edit my Cube.dts.
Currently simpleLaser can be Emissive, but Glow does not even show up in the editor, and neither effect maps to the in game Laser object.
Is there any location for a Material Editor crash course page or anyone that can give me any hints to getting my own materials mapped and ready for editting within the World Builder?
#2
11/23/2009 (8:28 pm)
another way to do it, is to select the mesh then click on the material icon. you can tweak real time from there, much faster.
#3
As for the Glow, I have a GeForce 9800 GT, and it's running under Windows XP. I've seen the glow work on occasion, but it seems to stop functioning quickly after startup, I'll see if I can find the cause.
I'll have to remember the mesh selection method of mapping materials.
11/23/2009 (10:04 pm)
Awesome, yeah, my issue was I was mapping it to the Mesh, like TorqueX does. Now that I've mapped it to the Texture, emissive is fully functional. Thank youAs for the Glow, I have a GeForce 9800 GT, and it's running under Windows XP. I've seen the glow work on occasion, but it seems to stop functioning quickly after startup, I'll see if I can find the cause.
I'll have to remember the mesh selection method of mapping materials.
#4
11/23/2009 (11:02 pm)
it doesn't auto save your adjustments, you may have to click the diskette icon for it to write to the changes material.cs file. i always forget to do it hehe.
#5
Edit: It shows up on other models, but not my BeamProjectile object.
BeamProjectile is a Projectile type that overrides onAdd, onProcessTick, onInterpolateTick, onExplosion, onPrepRender, among other things, though I call the base on onAdd and onPrepRender. Is there anything in particular that needs to be processed or called for an object to glow?
11/24/2009 (12:57 am)
Yeah I sometimes forget to do that too, but the issue I mean is toggling Glow doesn't even show up in the Material Viewer. I've seen it before, and I can 1 in 20 load up Torque and get it to show the glow effect, but it's not wanting to show up on my model or in the model viewer on any model.Edit: It shows up on other models, but not my BeamProjectile object.
BeamProjectile is a Projectile type that overrides onAdd, onProcessTick, onInterpolateTick, onExplosion, onPrepRender, among other things, though I call the base on onAdd and onPrepRender. Is there anything in particular that needs to be processed or called for an object to glow?
Associate Steve Acaster
[YorkshireRifles.com]
eg from stock
singleton Material(DefaultMaterial1) { mapTo = "building01walls"; diffuseMap[0] = "art/shapes/desertStructures/building01walls"; normalMap[0] = "art/shapes/desertStructures/building01wallsnorm.jpg"; };As for glow not working, post GPU and OS type.