Page 5 of 7

Re: irrRenderer 1.0

Posted: Sun Mar 22, 2015 7:25 pm
by ent1ty
You should be able to, but I have a feeling the final render to texture feature of irrRenderer isn't working right now. That should be easy to fix, but I have hit a problem with the transparent materials, can anyone else confirm that they are being incorrectly rendered when they should be hidden behind by walls?

edit: confirmed

Re: irrRenderer 1.0

Posted: Wed Mar 25, 2015 5:22 pm
by thanhle
Hi mate
calling createDefaultPipeline() after resize cause an error in the irrlicht addTexture function.

*deleted
Regards,
thanh

Re: irrRenderer 1.0

Posted: Wed Mar 25, 2015 5:34 pm
by thanhle
Request feature
------------------------
1) Can we have a flag or function call to turn off defer rendering.
2) Can we ignore light for scenenode without light enable?


I'll begin to study shader and will look at adding shadow.

regards
thanh

Re: irrRenderer 1.0

Posted: Wed Apr 01, 2015 11:25 am
by thanhle
Hi,
I have managed to enable deferred without texture.
But I have to use Param2 as a flag.
I heard that use if statement inside shader reduces the render performance.
Is there any way to remove if statement?

Code: Select all

 
 
solid.vert
uniform mat4 WorldViewProjMat;
uniform mat4 WorldViewMat;
uniform float CamFar;
 
varying vec3 Normal;
varying float Depth;
varying vec4 VertexColor;
 
void main()
{
    vec4 vertex = WorldViewProjMat * gl_Vertex;
    VertexColor = gl_Color;
    /*if(Lighting == 0.0)
    {
        Normal= vec3(0.0);
        Depth= 1.0; //automatically Z-reject these areas
    }
    else
    {*/
        Normal= normalize((gl_NormalMatrix * gl_Normal)).xyz;
 
        vec4 vVertex= WorldViewMat * gl_Vertex;
        Depth= vVertex.z/CamFar;
    //}
 
    gl_Position= vertex;
    gl_TexCoord[0]= gl_MultiTexCoord0;
}
 
solid.frag
varying vec3 Normal;
varying float Depth;
 
uniform float Lighting;
uniform float Param2;
uniform sampler2D Tex0;
varying vec4 VertexColor;
 
void main()
{
    vec3 vNormal= normalize(Normal);
    vNormal*= 0.5;
    vNormal+= 0.5;
    
    vec4 col = texture2D(Tex0, vec2(gl_TexCoord[0]));
    
    if(Param2 == 1.0)
    {
        col.xyz = VertexColor.xyz;
    }
    else
    {
        col.xyz *=  VertexColor.xyz;
    }
    
    float vDepth= Depth;
 
    /*if(Lighting == 0.0)
    {
        vNormal= vec3(0.0, 0.0, 0.0);
        vDepth= 1.0;
    }*/
 
    gl_FragData[0] = col; //texture2D(Tex0, gl_TexCoord[0].xy);
    // set normal to 0 for objects that should not receive lighting
    gl_FragData[1] = vec4(vNormal * Lighting, 0.0);
    gl_FragData[2] = vec4(vDepth, 0.0, 0.0, 0.0);
}
 
 
 
Another question:
With Nadro new update in the trunk, irrRenderer break in a few places. Have you update irrRender to the new changes?

Thanks,
thanh

Re: irrRenderer 1.0

Posted: Wed Apr 01, 2015 11:28 am
by CuteAlien
@thanhle: Please update again, we've added one wrapper for old functions back in. Not sure if it's enough for irrRender. If not can you please post the error you get?

Re: irrRenderer 1.0

Posted: Wed Apr 01, 2015 11:45 am
by thanhle
Hi CuteAlien

1) IRenderTarget missing the argument or the interface have changed.

e.g. irr::video::IRenderTarget(Device->getVideoDriver()->addRenderTargetTexture(dimension, name, format)) //Will trigger error.

2) IRenderTarget no longer has a public variable RenderTexture .

Regards
thanh

Re: irrRenderer 1.0

Posted: Wed Apr 01, 2015 12:12 pm
by CuteAlien
Uhm ok.. have to leave those to Nadro due to lack of time :-(

Re: irrRenderer 1.0

Posted: Wed Apr 01, 2015 12:28 pm
by thanhle
I think Entity is revamping the irrRenderer interface or something. There's a topic about that in the advanced help forum.
I'm going to hunt him for that hehe :)

Hopefully he's still alive then.

regards
thanh

Re: irrRenderer 1.0

Posted: Wed Apr 01, 2015 1:07 pm
by Nadro
Older IRenderTarget structure was broken. There is new RT interface for support things like MRT. I can update irrRenderer in upcoming days ;)

Re: irrRenderer 1.0

Posted: Wed Apr 01, 2015 1:28 pm
by thanhle
Cool! thanks.
Keep up the great work Nadro.

regards,
thanh

Re: irrRenderer 1.0

Posted: Fri Apr 03, 2015 4:14 am
by thanhle
Directional light bug.
When directional light X angle is 270 degree.
If we rotate the camera near horizontal, at some angles the light switch off on the surface.
I'm not sure it is Irrlicht's light problem or deferred render problem.

Regards
thanh

Re: irrRenderer 1.0

Posted: Sat Apr 04, 2015 7:55 am
by ent1ty
I am indeed updating irrRenderer for the latest trunk version (the branch "update" in the git repo). Currently transparent material are still broken, I'm hoping to get some time to work on that next week (currently on Easter holidays :P ).

Re: irrRenderer 1.0

Posted: Sat Apr 04, 2015 3:29 pm
by CuteAlien
Note that Nadro and me have been heavily discussing some changes related to transparent materials last few days. There might be another change - or maybe not - that's kinda what the discussion is about :-) But I'll keep you informed, just maybe wait a few days until we have decided that (hopefully done next week).

Re: irrRenderer 1.0

Posted: Sat Apr 04, 2015 10:37 pm
by thanhle
Cool, can't wait for high detail distance sorting for transparent objects.
Regards,
Thanh

Re: irrRenderer 1.0

Posted: Sun Apr 05, 2015 1:21 am
by CuteAlien
Ehm, sorry to disappoint you, but the discussion is just about a recent patch that causes some troubles and how we can fix that again.