Horde3D

Next-Generation Graphics Engine
It is currently 13.05.2024, 07:24

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 10.11.2009, 09:50 
Offline

Joined: 07.11.2009, 16:07
Posts: 5
I am trying to use the shader described in the Wiki to make a glass-like material. Now, as I understand it, the link provided in the download section is in the old XML format and I did some minor formatting to bring it up to speed with the new format. So, the current version I am using is as found here.

The shader seems to be compiling fine (atleast, the html log does not indicate anything to the contrary.) In any case it would be nice if someone could take a glance and see if things are in order. Despite enabling H3DOptions::DumpFailedShaders, I don't get a separate log txt file generated, even when I intentionally introduce typos in the GLSL code to force errors (this registers on the HTML log however). So firstly, I'd like to know what this might be due to.

In any case, the model (a simple sphere) does not render AT ALL. Hence this post. I have tried using the forward rendering pipeline as well as the deferred rendering pipeline. As I understand it, the forward rendering pipeline definition that comes with the example only defines ambient and transparent contexts and will draw only those objects with ambient/transparent contexts in the shaders referenced by their material definitions. The fresnel shader used currently defines ambient, shadowmap, attrib and lighting contexts which come into play only when deferred shading mode is used. Is this correct? I haven't set any class in the model's material definition. I reckoned that this shader seems to define an ambient, attrib and shadow passes for whatever reason and might not need me to filter it out into translucent etc. Please tell me if I am missing anything.

Code:
<Material>
   <Shader source="shaders/fresnel.shader" />

   <Sampler name="tex0" map="models/skybox/skybox.dds" />
</Material>


Top
 Profile  
Reply with quote  
PostPosted: 23.11.2009, 00:38 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Sorry, the reply might be a bit too late for you but anyway...

Hannofcart wrote:
Despite enabling H3DOptions::DumpFailedShaders, I don't get a separate log txt file generated, even when I intentionally introduce typos in the GLSL code to force errors (this registers on the HTML log however). So firstly, I'd like to know what this might be due to.

I did a quick test and it is working as expected for me. The files which are output are called "shdDumpVS.txt" and "shdDumpFS.txt".

Hannofcart wrote:
In any case, the model (a simple sphere) does not render AT ALL. Hence this post. I have tried using the forward rendering pipeline as well as the deferred rendering pipeline. As I understand it, the forward rendering pipeline definition that comes with the example only defines ambient and transparent contexts and will draw only those objects with ambient/transparent contexts in the shaders referenced by their material definitions.

This is right. However, the LIGHTING and SHADOWMAP (if you use shadows) contexts are required as well in the forward pipeline. The context names are defined as properties of the light node. ATTRIB is the only context used exclusively by the deferred pipeline.

When an object is not visible at all with a new shader, I usually try to reduce the shader to a minimum (e.g. just outputting a red color in the ambient pass) and then I incrementally add the additional features, always testing the steps. Usually this makes it pretty easy and quick to locate a problem.


Top
 Profile  
Reply with quote  
PostPosted: 01.02.2010, 00:15 
Offline

Joined: 18.09.2009, 07:44
Posts: 17
I seem to have a similar issue with the code pasted by Hannofcart, my log shows:

Code:
Shader resource 'shaders/fresnel.shader': FX: unexpected token (line 4)

If I enable dumpfailedshaders, shdDumpVS.txt and shdDumpFS.txt fail to appear.

I wonder if this is because I'm handing the loading of my assets from memory rather than using LoadResourcesFromDisk?


Attachments:
fresnel.txt [5.77 KiB]
Downloaded 617 times
Top
 Profile  
Reply with quote  
PostPosted: 01.02.2010, 02:47 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Hmm, since I could not reproduce this last time, could you set a breakpoint in egShader.cpp where dumpFailedShaders is handled to see what is going wrong?
By debugging into the parser, it would be easy as well to find out why you get an error in the FX section (might be a horde bug).


Top
 Profile  
Reply with quote  
PostPosted: 02.02.2010, 03:52 
Offline

Joined: 18.09.2009, 07:44
Posts: 17
The log error was my mistake, rather than sampler2D I had sampler. For completeness, the fixed shader is attached.

Unfortunately, I'm still unable to see the object the shader is applied to. I'll follow your advice marciano and see if I can work out the problem.


Attachments:
fresnel.txt [5.76 KiB]
Downloaded 656 times
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 17 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:  
Powered by phpBB® Forum Software © phpBB Group