Page 1 of 1

Nice update in trunk today

Posted: Mon Apr 06, 2015 4:40 pm
by thanhle
Great update in trunk today.
Looks like transparent object correctly displays without z sorting issue when camera moves/rotate

Image

Even deferred render receive some lights.
But not sure why transparent is too much transparent. Even alpha is set to 254. Maybe I did it wrongly.
I used:

Code: Select all

    IMeshManipulator *manip = device->getSceneManager()->getMeshManipulator();
 
for (int j = 0; j < mNode->getMaterialCount(); ++j)
{
     mNode->getMaterial(j).MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA;
      for (int k = 0; k < mNode->getMesh()->getMeshBufferCount(); ++k)
      {
            manip->setVertexColorAlpha(mNode->getMesh()->getMeshBuffer(k), value);
      }
}
Any suggestion of how I can make transparent work correctly?

Thanks
thanh

Re: Nice update in trunk today

Posted: Mon Apr 06, 2015 5:23 pm
by CuteAlien
Does it change at all when you change the alpha value?

Re: Nice update in trunk today

Posted: Mon Apr 06, 2015 5:49 pm
by ent1ty
This is a bug in irrRenderer, I think - are you using the "update" branch from my git repo? Transparent materials are still broken :)
I have seen a similar thing myself, however I haven't fixed it yet.

Re: Nice update in trunk today

Posted: Mon Apr 06, 2015 5:54 pm
by thanhle
Yes it does go lighter as alpha becomes smaller.
But there is a big alpha change between 255 and 254.

Regards
thanh

Re: Nice update in trunk today

Posted: Mon Apr 06, 2015 6:00 pm
by thanhle
@ent1ty
Yup! your updated branch : ). With slightly changed to the flags.

void scene::ILightManagerCustom::OnPreRender(core::array<ISceneNode*> &lightList)
{
Device->getVideoDriver()->setRenderTarget(RenderTarget, RenderIndices, true, true, false);// , video::SColor(255, 255, 0, 0));
}


void scene::ILightManagerCustom::OnRenderPassPostRender(scene::E_SCENE_NODE_RENDER_PASS renderPass)
{
if (renderPass == scene::ESNRP_SOLID)
{
Device->getVideoDriver()->setRenderTarget(0, 0, true, false, false, 0);
deferred();
Device->getVideoDriver()->setRenderTarget(RenderTarget, RenderIndices, false, false, false, 0);

}
else if (renderPass == scene::ESNRP_TRANSPARENT)
{
Device->getVideoDriver()->setRenderTarget(0, 0, false, false, false, 0);
deferred();
}
}


I see, but from my my test, transparent object does receive the light.
Only just that it is too much alpha transparent : ).

Regards
thanh

Re: Nice update in trunk today

Posted: Mon Apr 06, 2015 6:53 pm
by ent1ty
Well, yes, that is what I meant by 'broken' :D
It is not, in fact, an updated branch, but rather a work in progress 'update' you're not really meant to use :P But I'm hoping to fix the transparent materials and merge into master soon-ish :)

Re: Nice update in trunk today

Posted: Tue Apr 07, 2015 3:52 am
by thanhle
Hehe, I can't wait to use it.

Because I need to somehow trying to fix the directional light issue.As the light dims and also at some angle it turns off. There is clearly issue with the dot product at 90 degree as light = 0.
I think since we have the ambient separately, directional light shader would only work with diffuse component.

Regards
thanh

Re: Nice update in trunk today

Posted: Fri May 15, 2015 9:13 pm
by chronologicaldot
Hurray!!
But - do partially-transparent textures work? For me, it seems it's only transparent when the texture is fully transparent.