[SOLVED] Problems with material files: rtshader_system is not recognized

Problems building or running the engine, queries about how to use features etc.
Post Reply
HarlockOne
Gnoblar
Posts: 10
Joined: Tue May 04, 2021 4:21 pm
x 1

[SOLVED] Problems with material files: rtshader_system is not recognized

Post by HarlockOne »

Hi All,
Recently have managed to both import fbx models and mesh/scene exported ones through the blender2ogre python plugin, BUT, during the mesh creation procedure I get this ugly error:

Code: Select all

Error: ScriptCompiler - unexpected token in Cigar_Mat.material(32): 'rtshader_system'. If this is a legacy script you must prepend the type (e.g. font, overlay).
Error: ScriptCompiler - unexpected token in Cigar_Mat.material(32): token "rtshader_system" is not recognized
Error: ScriptCompiler - unexpected token in Clothes_MAT.001.material(32): 'rtshader_system'. If this is a legacy script you must prepend the type (e.g. font, overlay).
Error: ScriptCompiler - unexpected token in Clothes_MAT.001.material(32): token "rtshader_system" is not recognized
Error: ScriptCompiler - unexpected token in Clothes_MAT.material(32): 'rtshader_system'. If this is a legacy script you must prepend the type (e.g. font, overlay).
Error: ScriptCompiler - unexpected token in Clothes_MAT.material(32): token "rtshader_system" is not recognized
Error: ScriptCompiler - unexpected token in Eyes_MAT.001.material(32): 'rtshader_system'. If this is a legacy script you must prepend the type (e.g. font, overlay).
Error: ScriptCompiler - unexpected token in Eyes_MAT.001.material(32): token "rtshader_system" is not recognized
Error: ScriptCompiler - unexpected token in Eyes_MAT.material(32): 'rtshader_system'. If this is a legacy script you must prepend the type (e.g. font, overlay).
Error: ScriptCompiler - unexpected token in Eyes_MAT.material(32): token "rtshader_system" is not recognized
Error: ScriptCompiler - unexpected token in Skin_MAT.material(32): 'rtshader_system'. If this is a legacy script you must prepend the type (e.g. font, overlay).
Error: ScriptCompiler - unexpected token in Skin_MAT.material(32): token "rtshader_system" is not recognized
This is how one of the material files look like:

Code: Select all

// Clothes_MAT.001 generated by blender2ogre 2021-05-05 22:34:55.490852

material Clothes_MAT.001 {
    receive_shadows on
    technique {
        pass {
            diffuse 1.0 1.0 1.0 1.0
            specular 0.623338 0.623338 0.623338 1.0 77.778
            alpha_to_coverage off
            colour_write on
            depth_check on
            depth_func less_equal
            illumination_stage per_light
            light_clip_planes off
            light_scissor off
            normalise_normals off
            polygon_mode solid
            scene_blend_op add
            shading gouraud
            transparent_sorting on

            texture_unit {
                texture Boss_diffuse.PNG
                tex_address_mode wrap
                colour_op modulate
            }
            texture_unit {
                texture Boss_specular.PNG
                tex_address_mode wrap
                colour_op modulate
            }
            rtshader_system {
                lighting_stage normal_map Boss_normal.PNG
            }
        }
    }
}
Tried to find something about but nothing really helped me.
I really doubt that the blender2ogre python translation failed by adding some json tags that can not be recognized by the RT Shader module.
I have compiled ogre from scratch with the Cg support.
Thanks!

Ogre Version: :1.12.11:
Operating System: :win32:
Render System: :opengl:
Last edited by HarlockOne on Fri May 07, 2021 11:04 pm, edited 1 time in total.
paroj
OGRE Team Member
OGRE Team Member
Posts: 1993
Joined: Sun Mar 30, 2014 2:51 pm
x 1073
Contact:

Re: Problems with material files: rtshader_system is not recognized

Post by paroj »

I guess you dont use the ApplicationContext?
Then you have to call "Ogre::RTShader::ShaderGenerator::initialize()" before adding any resources for the keyword to be recognized.
HarlockOne
Gnoblar
Posts: 10
Joined: Tue May 04, 2021 4:21 pm
x 1

Re: Problems with material files: rtshader_system is not recognized

Post by HarlockOne »

Hi paroj,
Yep that did the trick :)
You are right I am not using any ApplicationContext...I am building up all the ogre, input, sound, physics resources by hand.
Thanks!
Post Reply