Where is the terra material->vs/ps assignment?

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
Nickak2003
Gremlin
Posts: 192
Joined: Thu Jun 10, 2004 4:19 am
x 11
Contact:

Where is the terra material->vs/ps assignment?

Post by Nickak2003 »

I am studying terra, and am looking for where the terra vertex and pixel shaders are assigned. Is there a material file other than the .material.json that I have overlooked?

Lax
Orc
Posts: 476
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 30

Re: Where is the terra material->vs/ps assignment?

Post by Lax »

Hi,

terra has its own hlms infrastructure. Which is located at: "..\Ogre2.2SDK\Samples\Media\Hlms\Terra".
Vertex and Pixelshader are also located there.

Best Regards
Lax
Image
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
Image

Nickak2003
Gremlin
Posts: 192
Joined: Thu Jun 10, 2004 4:19 am
x 11
Contact:

Re: Where is the terra material->vs/ps assignment?

Post by Nickak2003 »

I know where that stuff is at. I mean, in the C++, I do not see where that stuff is linked, normally a material specifies its vs and ps programs. I do not see where the terra vs/ps. I know where they are in the file structure, but not where they are linked in the c++.

Nickak2003
Gremlin
Posts: 192
Joined: Thu Jun 10, 2004 4:19 am
x 11
Contact:

Re: Where is the terra material->vs/ps assignment?

Post by Nickak2003 »

Ok, i guess it is through the custom terra-hlms.

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4501
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 936
Contact:

Re: Where is the terra material->vs/ps assignment?

Post by dark_sylinc »

The vertex and pixel shaders are (do for each backend):
  • Samples/Media/Hlms/Terra/GLSL/PixelShader_ps.glsl
  • Samples/Media/Hlms/Terra/GLSL/VertexShader_vs.glsl
Which use pieces defined in Samples/Media/Hlms/Terra/Any, which at the same time reuse pieces defined by Samples/Media/Hlms/Pbs/Any

As for the C++ code, the shader is generated and linked by Hlms::compileShaderCode (overload 1) which loops and gathers through all piece files, finally processes VertexShader_vs.glsl/PixelShader_ps.glsl to generate the final shader source code and calls Hlms::compileShaderCode (overload 2) which actually performs gpuProgramManager->createProgram() and then calls gp->load() to compile it.

Post Reply