Game Development Community

Torque 3D Beta 4/5 Bug: TerrainCellMaterial::init - Failed to create pass!

by Stephane Conde · in Torque 3D Professional · 07/22/2009 (12:40 am) · 11 replies

Just downloaded Beta 4 and am now getting the following errors in the console when running a completely unmodified Warrior Camp:

*** Initial Control Object
Failed to create resource: [core/fonts/Arial 12 (ansi).uft]
Failed to create resource: [core/fonts/ArialBold 32 (ansi).uft]
Activating DirectInput...
Failed to create resource: [core/fonts/Arial 16 (ansi).uft]
TerrainCellMaterial::init - Failed to create pass!
TerrainCellMaterial::init - Failed to create pass!
[FileSystemChangeNotifier::internalNotifyDirChanged] : [levels]
Mapping string: setNumericalHealthHUD to index: 16
[FileSystemChangeNotifier::internalNotifyDirChanged] : [levels]

Terrain is now completely missing in sections. Below is a screenshot of the issue.

img525.imageshack.us/img525/5185/screenshot00100000.th.png

Not sure if this is related to a Torque 3D Beta 3 Bug I had. And as I mentioned in that thread, things were working great in Beta 2.

I am running with the latest drivers from ATI.
Any help or insight you could provide would be great!

#1
07/23/2009 (1:55 am)
This appears to be related to the bug I had in Torque 3D Beta 3. The compilation error I get (when I re-enabled shader compile errors) is the following:

GFXD3D9Shader::_compileShader - Error compiling shader: E_FAIL: An undetermined error occurred (80004005)
c:/Documents and Settings/Stephane Conde/My Documents/Waking Games/build_current/game/shaders/procedural/7381d336936dd3d5_P.hlsl(74,16): error X5608: Compiled shader code uses too many arithmetic instruction slots (74). Max. allowed by the target (ps_2_0) is 64.

Since there is only 1 material for the shader, it cannot be broken down into multiple shaders and therefore fails entirely, giving the "TerrainCellMaterial::init - Failed to create pass!" error.

If I remove the fog freature, the shader compiles and the terrain base textures get rendered, but I am back to my original issue from Beta 3 where some detail textures are not getting rendered.

Seems like there are some gremlins here.

Let me know if there is anything else I can do to try and narrow down what the issue is.

Stephane
#2
07/23/2009 (2:07 pm)
@Stephane

Well for one in the future i will have it fallback to using the normal non-detailed mapped material if the detail mapped materials fail to be created. This will at least give someone terrain if they're hardware cannot support things for whatever reason.

Quote:Since there is only 1 material for the shader, it cannot be broken down into multiple shaders
So this is with your own terrain with a single material? Is this just a simple material... detail only... or does it have normal maps and parallax?

Quote:If I remove the fog freature, the shader compiles and the terrain base textures get rendered, but I am back to my original issue from Beta 3 where some detail textures are not getting rendered.
So even for your simple terrain with one material... you have to remove the fog feature in code to get the terrain to render? And even then the detail texture of your terrain still doesn't appear... just the base texture?
#3
07/23/2009 (2:16 pm)
Is that on a shader model 2.0 card? I'm surprised some of the AL shaders even compiled at all.
#4
07/23/2009 (9:10 pm)
@tom

Thank you very much for your reply.

This is all in a completely unmodified run of the WarriorCamp. The terrain materials there do not have normal or parallax maps. That shouldn't really matter as I don't think my card supports running in Advanced Lighting.

Are you guys not seeing this at Garagegames with pixel shader 2.0 cards?

And yes, if I skip over the adding of the fog feature using the debugger while running WarriorCamp then the terrain renders fine, save for detail textures not appearing in certain areas (same as Beta 3 issue).

It's strange though that things were working fine in Beta 2. Is it the addition of the fogging feature to the terrain shader that is pushing this limit?

@manoel

Thank you for your reply, although I'm not sure I know what you mean... I'm running the game in Basic Lighting on a graphics card with pixel shader model 2.0. As I mentioned above, I don't think my card supports Advanced Lighting... Was there something that made you think Advanced Lighting shaders were being compiled by my card?
#5
07/30/2009 (11:28 pm)
A bit of an update. The issue with detail textures not being rendered is resolved with the fix found in this thread: www.garagegames.com/community/forums/viewthread/95415/1.

Still have issues with too many arithmetic instructions in the terrain shader. This seems to be a case of just too much going on in the shader. Removing the real-time lighting or fogging features brings the arithmetic instruction count down low enough that the shader compiles and runs, but obviously missing the feature that was removed. Not sure if there are any ways to optimize the shader to bring the arithmetic operation count down... maybe less than 4 real-time lights?
#6
07/30/2009 (11:45 pm)
Well whats disapointing is that on your card not even one material per-pass works it seems.

The ATI Radeon X1250 is a fairly old card and even if it worked it would perform terribly. It seems its a pure 2.0 card so your pixel shader instruction limits are 32 texture + 64 arithmetic. Thats a really tight fit... but i would have expected at least one material at a time to work. I guess its still too big even then.

For now i think you'll need to stick to Basic Lighting which will work really well on your card.

In Torque 3D 1.1 we'll do another pass on Advanced Lighting and see if we can cut some corners to make it work on lower end systems.
#7
07/31/2009 (12:04 am)
Hey Tom... As I mentioned in my second to last post in this thread, I am already running in Basic Lighting (my card doesn't even support Advanced Lighting) and am seeing this issue. Understandably, if I were somehow able to run in Advanced Lighting I would not expect very much of anything on my card, but I am definitely running in Basic Lighting...
#8
07/31/2009 (12:10 am)
Duh... sorry... too much coding has burnt out my brain.

Well thats a much more serious issue. I'll see if i can emulate the effect here tonight and get it resolved by morning.
#9
07/31/2009 (1:02 am)
No worries.

There's definitely no rush, I was just making sure it wasn't forgotten about. Thanks for looking into it!
#10
08/14/2009 (1:46 am)
Just wanted to update this thread and mention that this is still definitely an issue in Beta 5.

Cheers,

Stephane
#11
09/02/2009 (6:10 pm)
Logged as THREED-730