Horde3D

Next-Generation Graphics Engine
It is currently 01.11.2024, 05:38

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Some shaders questions
PostPosted: 16.01.2008, 01:21 
Offline

Joined: 16.01.2008, 00:24
Posts: 73
Location: Canada/Quebec
I'm a student in computer science and, with some friends, ive started a video game project. I was searching for a recent game engine and I found horde3d wich look really nice. I tried Ogre for a little game I made some time ago, but it is a realy big engine and it take a lot of time to compile and its why I decided to try horde3d.

I'm a little bit new to shader but i'm able to use every shader that comes with the engine. The problem is that I'm not able to import new shader in the engine. I was doing this tutorial and I'm just not able to implement a simple shader wich set every fragment to green.

I think the problem is the context id in the shader XML script. I cant found any definition of them anywhere so I dont understand what they mean and the difference between them.

Maybe I should have more experience with OpenGL? Ive already done an application with OpenGL some time ago, in wich I used ODE Physic and some basic animation with the MD2 Quake format so I know the basic.

And I would like to know what is the minimum shader XML script for a basic mesh shown in horde3D wich include no particular effect.

Thanks for any help!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 16.01.2008, 04:58 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
The "Context id" thing is a Horde-specific feature - it's not related to OpenGL of GLSL at all. These Context id's match up with context id's specified inside the pipeline XML files, which describe what steps need to be taken to draw the scene.
In other words, each context in the shader file is really a different version of the same shader. Depending on how the scene is going to be rendered, the renderer may need to use one or more of these differing shader versions/contexts.


Horde uses XML files to 'wrap up' a GLSL vertex shader and fragment shader into a single file.

You should be able to just copy an existing horde shader (such as "parallax.shader.xml") and edit the code within the "<![CDATA[" and "]]>" tags (i.e. the section of the file that actually contains GLSL code).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 17.01.2008, 05:24 
Offline

Joined: 16.01.2008, 00:24
Posts: 73
Location: Canada/Quebec
Ive didnt noticed that the context ID was defined int the pipeline XMP script. I'll try to buy a book to learn about GLSL cause I'm a bit lost in this. For now, I will use those shaders that came with the horde SDK until I'm getting more in this.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 17.01.2008, 13:38 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
Mikmacer wrote:
Ive didnt noticed that the context ID was defined int the pipeline XMP script. I'll try to buy a book to learn about GLSL cause I'm a bit lost in this. For now, I will use those shaders that came with the horde SDK until I'm getting more in this.


While the GLSL book will be useful, it wont help with this particular issue, because the contexts are a Horde-specific feature. Basically, every time you draw something (in pipeline.xml), you specify a context, and then Horde uses only the shaders that match the context from each material.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 17.01.2008, 21:25 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
The shader contexts are especially useful in combination with light sources. You can assign a context name to a light and then it does its lighting calculations using the correseponding GLSL shader of the materials.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group