irrRenderer 1.0

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

Re: irrRenderer 1.0

Postby thanhle » Tue Apr 07, 2015 9:18 am

Temporary fix for direction light. Removed sudden light switch off at singularity (dot product 90degree).

cpp Code: Select all
uniform sampler2D ColorTex;     //guess what :P
uniform sampler2D NormalTex;    //view space normal.xy
uniform sampler2D DepthTex;    //view space depth
uniform vec3 Direction;
uniform vec3 Color;
 
void main()
{
    vec4 vNormal= texture2D(NormalTex, gl_TexCoord[0].xy);
 
    //reconstruct normal
    vNormal.xy*= 2.0;
    vNormal.xy-= 1.0;
    vNormal.z= -sqrt( -(vNormal.x*vNormal.x) - (vNormal.y*vNormal.y) + 1.0 );
    //calculate the light
   
    vec4 lightDir= vec4(normalize(Direction), 0.0);
    float NdotL = max(dot(normalize(vNormal), lightDir), 0.0);
   
    // Temp fix of the bug of the dot product at angle 90degree.
    // This is useful for Phong shade and 1/2 vector calculation.
    float rim = pow(1.0 - NdotL, 4.0); //Use the power constant 2,3... //Smaller power for softer light shadow.
    vec4 Diffuse =  vec4(Color,0.0)*texture2D(ColorTex, gl_TexCoord[0].xy);
   
    gl_FragColor= rim*Diffuse;
}
 


Ambient light shader seems to have same calculation as directional.
Why don't we merge ambient with directional? Or can we access Ambient light data inside directional light?

Regards
thanh
Last edited by thanhle on Tue Apr 07, 2015 12:01 pm, edited 1 time in total.
thanhle
 
Posts: 324
Joined: Wed Jun 12, 2013 8:09 am

Re: irrRenderer 1.0

Postby ent1ty » Tue Apr 07, 2015 11:31 am

thanhle wrote:Why don't we merge ambient with directional?

Because you can have ambient light without directional light or multiple directional lights :) Attempting to merge ambient end directional would result in some special cases that would be painful to handle :P

Thanks, I will take a look at the bug in directional lighting as soon as I fix transparent materials.


By the by, does anyone have any advice on how to handle lighting for transparent billboards (i.e. volumetric smoke)? I think you always want t pretend that the normal faces whatever light you're currently calculating, but you also have to remember to still take the normal into account for other transparent nodes that don't rotate to face the camera. The issue I have is I'm unsure how to handle this gracefully in shaders.
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
User avatar
ent1ty
Competition winner
 
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Re: irrRenderer 1.0

Postby thanhle » Tue Apr 07, 2015 1:29 pm

Another way to fix the light flashing issue.
Different way of calculating the normal. Maybe we need a better way to calculate the normal.

cpp Code: Select all
 
uniform sampler2D ColorTex;     //guess what :P
uniform sampler2D NormalTex;    //view space normal.xy
uniform sampler2D DepthTex;    //view space depth
uniform vec3 Direction;
uniform vec3 Color;
 
void main()
{
 // Get normal from texture
    vec4 vNormal = normalize((texture2D( NormalTex, gl_TexCoord[0].xy) * 2) - 1);
       
    vec4 lightDir= vec4(-normalize(Direction), 0.0);
    float NdotL = max(dot(vNormal, lightDir), 0.0);
   
      vec4 color = vec4(0);
    if(NdotL > 0) {
     vec4 Diffuse =  vec4(Color,0.0)*texture2D(ColorTex, gl_TexCoord[0].xy);
    color+=  NdotL*Diffuse;
 
    }
   
    gl_FragColor = color;
}
thanhle
 
Posts: 324
Joined: Wed Jun 12, 2013 8:09 am

Re: irrRenderer 1.0

Postby CuteAlien » Thu Apr 09, 2015 10:13 pm

Might be Irrlicht also needs another change - I just noticed latest change broke tests which it shouldn't have broken. But need some more time to investigate what's going on.
IRC: #irrlicht on irc.freenode.net
Code snippets, patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Free racer created with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
User avatar
CuteAlien
Admin
 
Posts: 8150
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: irrRenderer 1.0

Postby The_Glitch » Tue Jul 07, 2015 3:49 pm

I'd like to look into this project for use. I have a few questions though.

1). Will this work with shader pipeline?
2). I've been developing RNM for Irrlicht and is the lighting solution I currently use, I've read the deferred rendering basically made my solution deprecated lol.
3). Will this work on windows currently?
User avatar
The_Glitch
Competition winner
 
Posts: 521
Joined: Tue Jan 15, 2013 6:36 pm

Re: irrRenderer 1.0

Postby christianclavet » Tue Jul 07, 2015 6:11 pm

Hi, If you mean RNM are directionnal Lightmaps, I've found this on the Unity site and there no mention that it's can be used in deferred rendering.
http://docs.unity3d.com/Manual/LightmappingDirectional.html
User avatar
christianclavet
 
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA

Re: irrRenderer 1.0

Postby The_Glitch » Tue Jul 07, 2015 6:46 pm

What I meant in question 2 is would deferred rendering be better for me as I'm kinda tired of lightmaps. I don't care if I can't use them anymore just wondering if it's a good replacement.
User avatar
The_Glitch
Competition winner
 
Posts: 521
Joined: Tue Jan 15, 2013 6:36 pm

Re: irrRenderer 1.0

Postby christianclavet » Wed Jul 08, 2015 3:49 pm

Deffered rendering won't do any shadow. You need lightmaps to do that.

The deferred shading will be able to render tons of lights, will give a much better performances on lighting than forward rendering, But the shadowing (shadow that is casted from the object must be rendered via lightmaps)
Look here: http://gamedevelopment.tutsplus.com/articles/forward-rendering-vs-deferred-rendering--gamedev-12342
User avatar
christianclavet
 
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA

Re: irrRenderer 1.0

Postby The_Glitch » Fri Jul 10, 2015 7:49 pm

Is the any projects or solutions so I can compile this on windows?
User avatar
The_Glitch
Competition winner
 
Posts: 521
Joined: Tue Jan 15, 2013 6:36 pm

Re: irrRenderer 1.0

Postby ent1ty » Sat Jul 11, 2015 2:38 pm

I think you can either use the makefile with mingw make or the Code Blocks project.
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
User avatar
ent1ty
Competition winner
 
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Re: irrRenderer 1.0

Postby Jibreel Yahya » Fri Oct 23, 2015 8:19 pm

Hi, guys.
The irrRenderer compiles and works fine, but I had a problems with irrPP. I'm using Visual C++ 2015 with Irrlicht 1.9 from SVN:
The compilation works fine, but the execution results in 'Access violation reading location 0x00000000' in the file 'CPostProcessingEffectChain.cpp', in the function 'readShader'.
Here occurs the breakpoint: irr::u32 size = file->getSize();
I tested previous Visual C++ versions and previous Irrlicht versions, but occur the same error.

Sorry my poor English. :D

Some idea ?
Jibreel Yahya
 
Posts: 6
Joined: Fri Oct 23, 2015 7:59 pm

Re: irrRenderer 1.0

Postby devsh » Fri Oct 23, 2015 11:51 pm

You can use cascaded fract() wrapped 3d volume signed distance clip-maps with opacity to cone-trace your shadows (with transparency and even color if you're willing to splash 75-50% more memory)

We'll be going in that direction as we have way to many triangles and transparent geometry to justify rendering a shadowmap
We chose to stream mesh data from Multiple OpenGL Contexts in many threads and do the other things, not because they are easy, but because they are hard! - JFK
User avatar
devsh
Competition winner
 
Posts: 1736
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK

Re: irrRenderer 1.0

Postby mongoose7 » Sat Oct 24, 2015 12:45 am

@JibreelYahya: Maybe it couldn't find the shader. Check your filepaths. Also, run the code from the location where it is meant to be run. You probably ran it in the IDE and the location was not correct.
mongoose7
 
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: irrRenderer 1.0

Postby Jibreel Yahya » Wed Oct 28, 2015 10:21 pm

@mongoose7: Thank you. The path for shaders was wrong.
Jibreel Yahya
 
Posts: 6
Joined: Fri Oct 23, 2015 7:59 pm

Re: irrRenderer 1.0

Postby AReichl » Thu Oct 29, 2015 8:45 am

When i checkout with GIT or SVN i get different sources ( specially regarding "irrPP" ).
So - which is the "right" one?
AReichl
 
Posts: 227
Joined: Wed Jul 13, 2011 2:34 pm

PreviousNext

Return to Project Announcements

Who is online

Users browsing this forum: No registered users and 1 guest