Horde3D

Next-Generation Graphics Engine
It is currently 21.11.2024, 20:09

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 20.10.2019, 16:18 
Offline

Joined: 17.10.2016, 10:48
Posts: 4
Hi,

First of all, thanks for adding OpenGL 4 support to Horde3D! It is really a pleasure to work with such a so lightweight 3D engine.

I have a question regarding shadow mapping.
Is there any reason why "Classes" are not supported when doing "DoDeferredLightLoop" in a pipeline?

I setup my pipeline using classes and make manipulation on the scene by switching classes between the different models according the user needs.
The problem is when I want to implement lighting and and shadowing, I cannot define which classes can contribute to shadow whereas lighting does due to G-Buffer use. By default, all classes contribute to shadow! How to avoid that?

Thanks.


Top
 Profile  
Reply with quote  
PostPosted: 20.10.2019, 21:22 
Offline

Joined: 17.11.2009, 17:00
Posts: 205
Location: Russia, Moscow
Hello.

DoDeferredLightLoop is rendering the light shapes like point and cone, and scene geometry is drawn before, on geometry pass. Therefore, there is no much sense in adding classes to this pipeline function.

As far as I understand, you wish to disable shadows for some groups of objects. You can do it in several ways. First, you can disable shadow casting of the specific light by disabling shadow maps:
Code:
h3dSetNodeParamI( lightNode, H3DLightNode::ShadowMapCountI, 0 );


Then, you can disable the specific node shadow casting:
Code:
h3dSetNodeFlags( meshNode, H3DNodeFlags::NoCastShadow, applyToChildNodes );


The third way is to make another call of DoDeferredLightLoop with noShadows parameter enabled for specific nodes with different shader context. Unfortunately, it seems that currently there is no way to use material classes for the case that you need...


Top
 Profile  
Reply with quote  
PostPosted: 21.10.2019, 09:09 
Offline

Joined: 17.10.2016, 10:48
Posts: 4
Hi,

To be honest, when looking the code and based on the theory, to generate the shadow map, you need to render the scene from the light's point of view. Whatever if you use forward lighting or deffered.

In Horde3D, the following method is used for forward lighting:
Code:
void Renderer::drawLightGeometry( const string &shaderContext, const string &theClass,
                                  bool noShadows, RenderingOrder::List order, int occSet )

this one for deffered lighting:
Code:
void Renderer::drawLightShapes( const string &shaderContext, bool noShadows, int occSet )

but in both of them, the following method is used to generate shadow map:
Code:
void Renderer::updateShadowMap();

which calls:
Code:
drawRenderables( _curLight->_shadowContext, "", false, &frustum, 0x0, RenderingOrder::None, -1 );

also, default "" class means all geometry, and no order.

I did a try by changing by updating the method:
Code:
void Renderer::updateShadowMap(const string &theClass, RenderingOrder::List order)

and in the pipeline :
Quote:
<DoDeferredLightLoop class="TheClass"/>

it works perfect. (in my case :wink: )

What do you think?


Top
 Profile  
Reply with quote  
PostPosted: 21.10.2019, 10:12 
Offline

Joined: 17.11.2009, 17:00
Posts: 205
Location: Russia, Moscow
Hmm, well, if it works then it is good :)
But probably in case of DoDeferredLightLoop the "class" should be renamed to something like "enableShadowsForClass" (or maybe something better :) )because it is only related to shadows (in case of forward lighting it is also used to discard geometry that is not of the selected class).

I think you can pull request the change to horde's repository.


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

All times are UTC + 1 hour


Who is online

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