Difference between revisions of "Basic Pipeline Tutorial"
(New page: {| border="0" | {{ContentBlock|width=800|color=white |content={{!!}} == Overview == In this tutorial, I will try to show you how the Horde3D pipeline system works. At the first look, wh...) |
m |
||
Line 22: | Line 22: | ||
<BR/> | <BR/> | ||
− | + | to this line: | |
{{CppSourceCode| | {{CppSourceCode| | ||
Line 56: | Line 56: | ||
<BR/> | <BR/> | ||
− | I have tried to make this pipeline as simple as possible. I will explain how it | + | I have tried to make this pipeline as simple as possible. I will explain how it works : |
{{CppSourceCode| | {{CppSourceCode| | ||
Line 66: | Line 66: | ||
</source>}} | </source>}} | ||
− | This tag means that | + | This tag means that its child tags gonna be pipeline tags related. |
<BR/> | <BR/> | ||
Line 79: | Line 79: | ||
− | This tag means that | + | This tag means that its child tags gonna be related to direct rendering tags. |
<BR/> | <BR/> | ||
Line 91: | Line 91: | ||
</source>}} | </source>}} | ||
− | The stage is here to include a series of actions, and you can have multiple | + | The stage is here to include a series of actions, and you can have multiple stages if you want, even if in this exmaple we have only one. It is useful since you can disable or enable a stage within an Horde3D function, and you can link it a material within the optional "link" attribute. If you want, you can look at the "globalSettings.material.xml" file to see what it contains, and if everyting is normal, you should see that a cube map is binded to the texture unit 7, this gonna be the ambient texture that will determine the ambient color of the scene. Finally, for each stages, don't forget to add an id, and in this example the id gonna be "FirstStage". |
<BR/> | <BR/> | ||
Line 113: | Line 113: | ||
</source>}} | </source>}} | ||
− | This tag is used to clear the | + | This tag is used to clear the content of the current target. The attribute "depthBuf" is used to determine if you want to clear the depth buffer of the target, and each "colBufX" is an attribute to clear the specified color buffer of the target. In this example, we use only one color buffer. |
<BR/> | <BR/> | ||
Line 129: | Line 129: | ||
<BR/> | <BR/> | ||
− | Now you have to compile the chicago example. Go in the "build" folder, and copy the new executable in the "win32" folder of the SDK. | + | Now you have to compile the chicago example. Go in the "build" folder, and copy the new executable in the "win32" folder of the SDK. If you execute this example you should see nothing. If you look at the engine log and there is no error, it means that everyhing have been rightly done. If you see a black screen, it's because there is no "AMBIENTCOLOR" in each shader linked to each geometry. You have to add this context to each used shaders. |
In the chicago sample, three shaders are used : one for the animated model one for the sky and one for the parform. Open the "skinning.shader.xml" file since it's the shader used for the animated man. Next, you have to add this within the "shader" tag: | In the chicago sample, three shaders are used : one for the animated model one for the sky and one for the parform. Open the "skinning.shader.xml" file since it's the shader used for the animated man. Next, you have to add this within the "shader" tag: | ||
Line 200: | Line 200: | ||
As you can see, the id of the context tag is "AMBIENTCOLOR", exactly like the context in our pipeline. It means that within this context this shader will be executed for the current geometry. Then, you have the "InsCode" tag. It is here to insert the "vertCommon.glsl" file wich contain some really useful functions for the vertex shader, like "calcWorldVec()" and "calcWorldPos()". Finally, I have tried to make the vertex and the pixel shader self-explained, so you can read them if you want to learn how basically the context for the shader is within Horde3D. | As you can see, the id of the context tag is "AMBIENTCOLOR", exactly like the context in our pipeline. It means that within this context this shader will be executed for the current geometry. Then, you have the "InsCode" tag. It is here to insert the "vertCommon.glsl" file wich contain some really useful functions for the vertex shader, like "calcWorldVec()" and "calcWorldPos()". Finally, I have tried to make the vertex and the pixel shader self-explained, so you can read them if you want to learn how basically the context for the shader is within Horde3D. | ||
− | Now you can execute the chicago sample and you should see each man moving, but they sould not have any animations because, in the shader, we don't use skinning. If you want to learn how skining work with Horde3D, look at the shader within the "AMBIENT" context of the file, and you should see the difference between both vertex shaders. For the other two | + | Now you can execute the chicago sample and you should see each man moving, but they sould not have any animations because, in the shader, we don't use skinning. If you want to learn how skining work with Horde3D, look at the shader within the "AMBIENT" context of the file, and you should see the difference between both vertex shaders. For the other two shaders, the one for the sly and the one for the platform, you can copy the "AMBIENT" context of each shaders file and name them "AMBIENTCOLOR" to see them in the scene. |
== Conclusion == | == Conclusion == | ||
− | Finally, I have tried to make this tutorial as simple as possible, with a basic pipeline, so that it | + | Finally, I have tried to make this tutorial as simple as possible, with a basic pipeline, so that it shouldn't be too hard for any programmers to learn how the pipeline system work. It's why there is no lighting or multiple buffers, but with the basics, you can learn more by yourself by looking at any of the others Horde3D SDK pipelines and by trying things by yourself! |
}} | }} |
Revision as of 12:21, 4 January 2009
|
|