Horde3D

Next-Generation Graphics Engine
It is currently 22.12.2024, 02:25

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 12.04.2013, 18:11 
Offline

Joined: 12.04.2013, 17:26
Posts: 3
I've been working on building a room with fire using Hord3D. I try to use the Opengl draw functions to visualize my pathfinding algorithm.
But I got this:
Attachment:
File comment: It seems like the fire is "culled" by the Opengl Quads an Lines.
2.JPG
2.JPG [ 55.07 KiB | Viewed 21115 times ]

I am thinking about to modify the particle shader. Anyway, is the rendering order to do with this problem? :?

I have modified my particle.shader like this:
Code:
context TRANSLUCENT
{
   VertexShader = compile GLSL VS_TRANSLUCENT;
   PixelShader = compile GLSL FS_TRANSLUCENT;
   
   ZWriteEnable = true;
   BlendMode = Replace;
}

The particle system became like this:
Attachment:
3.JPG
3.JPG [ 61.26 KiB | Viewed 21115 times ]

This change solves the "cover(culling)" problem, but the particle system became kind of "ugly", maybe something wrong with the texture?


Attachments:
File comment: The moving fire is covered by my Opengl grids.
1.JPG
1.JPG [ 66.83 KiB | Viewed 21115 times ]
Top
 Profile  
Reply with quote  
PostPosted: 12.04.2013, 19:23 
Offline

Joined: 27.03.2011, 08:40
Posts: 47
Location: Fi
Particles must be rendered last, and without writing to zbuffer.

I just played with this a bit, and here some hackish C# code:

Code:
        public override void Render(float time)
        {
            Camera.Update();

            // hide only particles
            h3d.setNodeFlags(particles.Node, (int)h3d.H3DNodeFlags.Inactive, true);
            h3d.render(Camera.Node);
            h3d.setNodeFlags(particles.Node, 0, true); // back to visible


            // draw GL stuff
// remember push all attribs (states) first, draw, then pop attribs


            // hide everything
            h3d.setNodeFlags(h3d.H3DRootNode, (int)h3d.H3DNodeFlags.Inactive, true);
            // set only particles visible
            h3d.setNodeFlags(particles.Node, 0, true);
            h3d.render(Camera.Node);

            h3d.setNodeFlags(h3d.H3DRootNode, 0, true); // all visible
        }



Then I had to modify forward.pipeline.xml,
Code:
         <ClearTarget depthBuf="true" colBuf0="false" />

I changed colBuf0="true" to false so second h3d.render() doesnt clear screen.
With my scene this works because I have skybox, so clearing isnt necassary anyway.


Top
 Profile  
Reply with quote  
PostPosted: 13.04.2013, 13:57 
Offline

Joined: 12.04.2013, 17:26
Posts: 3
Thanks! It works for me. I think it is the simplest solution.

Then I can move on!


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 20 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