Torque 3D Beta 1 Bug - Road and material selection causes crash
by Konrad Kiss · in Torque 3D Professional · 05/01/2009 (4:57 am) · 9 replies
When I create a road in a newly generated project (simple mission) and I select the material, certain materials will cause an instant crash. (ie. TerrainBlockMaterials)
About the author
http://about.me/konrad.kiss
#2
05/01/2009 (1:41 pm)
James, thanks for the explanation.
#3
05/04/2009 (5:00 pm)
Logged.
#4
05/21/2009 (3:49 am)
Has the issue with the road fighting for visability with the terrain got anything to do with this?
#5
05/21/2009 (3:57 am)
Probably not.
#6
So... what I think I'll do is clearly differentiate CustomMaterials from Materials in the material-field-dropdown and sort them to be at the bottom of the list. This way, you can still assign them if you happen to really have a CustomMaterial designed to work on your object with a TypeMaterialName field, but you won't do so accidentally thinking it is a regular Material.
08/25/2009 (11:32 am)
TerrainBlockMaterial is gone now so that problem is no more and I have been unable to cause any crashes by assigning other CustomMaterials, like even assigning water materials ( which are reeeally custom and don't work on a road ) still doesn't crash.So... what I think I'll do is clearly differentiate CustomMaterials from Materials in the material-field-dropdown and sort them to be at the bottom of the list. This way, you can still assign them if you happen to really have a CustomMaterial designed to work on your object with a TypeMaterialName field, but you won't do so accidentally thinking it is a regular Material.
#7
08/25/2009 (11:43 am)
Actually, on second thought, since the MaterialSelector is really more useful than the drop-down-list, maybe it should just be replaced with a textEdit field in the rare case you want to just type something in rather than look for it?
#8
I dream of autocompletion... :)
08/25/2009 (11:50 am)
Sounds good - if you want to select, use the material selector, otherwise enter the exact material name. I dream of autocompletion... :)
Associate James Ford
Sickhead Games
Actually it looks to me like all the materials defined in art/terrains/materials.cs need to be trashed. They point to old ShaderData(s) that don't exist anymore.
A little backstory for those interested...
The DecalRoad uses a Material while TerrainBlock uses a CustomMaterial. The difference is that Material renders using a shader created by shadergen with the general material features availible to it, while you write your own shader for CustomMaterial.
The result of writing your own shader is that it that you have full control over what it does, but you also make it very reliant on being passed the correct information. The shaders TerrainBlock uses have a very particular vertex format and very particular shader consts that DecalRoad does not know about.