Jump to content

Making lights and emissive surfaces work


njord
 Share

Recommended Posts

Hello guys.

We normally render our scene with framework functions. But for our mirrors, due to performance problems, we get the render with renderworld() function. Ofcourse by creating an extra buffer and using renderlights() function, we can render light sources too. But how to render emissive/glossive surfaces in addition ?

 

Basically I want this : use renderworld(), render light sources, see traffic light working all together.

 

Traffic light model is in LESDK 2.5\Models\Props\Switch.

It uses a switch.frag to make the lights glow in darkness by using mesh color as a parameter to shader, on line 183 :

 

gl_FragData[3] = texture2D(texture2,texcoord)*fragcolor.x + texture2D(texture3,texcoord)*(1.0-fragcolor.x);

 

Thanks in advance :D

Link to comment
Share on other sites

  • 3 weeks later...

Basically, when our application is like this :

 

RegisterAbstractPath("./xxx");
Graphics(800,600,0);
TFramework framework = CreateFramework();
TLayer layer = GetFrameworkLayer(0);
TCamera defaultCam = GetLayerCamera(layer);
BP L = GetLuaState();
lua_pushobject(L,framework);
lua_setglobal(L,"fw");
lua_pop(L,1);
SetGodRays(1);
SetHDR(1);
SetSSAO(1);
SetBloom(1);
SetAntialias(1);
SetShadowQuality(1);
SetTextureQuality(1);
OcclusionCulling(1);

TEntity ent = LoadModel(std::string("abstract::switch.gmf").c_str());

While(true)
{
 UpdateFramework();
 RenderFramework();
}

 

the switch.gmf emissive/glossive greenlight is lit by default. When the RenderFramework(); is changed to RenderWorld(); I cannot see any emissive greenlight. You can see the difference in the below screenshot. The traffic light on the left is rendered with RenderWorld() command, the one on the right is rendered with RenderFramework() command.

 

What I am asking is, what is the minimum code required to make emissive surfaces work, using RenderWorld(); . Afterall, RenderFramework() uses RenderWorld(), RenderLights() etc. on the background right ?

 

Thanks all

 

PS : We are insisting on using RenderWorld for our mirrors, because the performance drops immensely otherwise. However we need to see emissive surfaces such as vehicle signals and traffic lights from our mirrors. Also we need to see light sources, which can be implemented easily by using RenderLights & RenderWorld.

 

screenshot :

post-2442-0-81304500-1321353215_thumb.png

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...