Jump to content

AmbientLight problems


VeTaL
 Share

Recommended Posts

Got a new strange problem: ambient light dont work in game (in editor it works good in both edit and game modes).

 

All other types of lightning works quite fine, except ambient. I made level from Underground models just to test animation hands in GUI, and stuck with this problem.

 

Also, i made search through all files in project (with Ctrl+Shift+F), where i mention "Ambient" and i find, that i didnt use it nowhere. Then i searched for text "Ambient" with Total commander searching tool and again found nothing strange.

Finally, i added AmbientLight(Vec3(1)); into the main loop and again there isnt ambient lightning on the scene at all (not only on mine, also on tunnels.sbx)

 

What can cause this?

I think i have missed something small, but i spend a all evening trying to fix this before writing here.

Working on LeaFAQ :)

Link to comment
Share on other sites

Things to try:

 

  1. Is the ambient light in your project folder?
  2. Are there multiple ambient lights? (perhaps causing interference)
  3. Delete the ambient light in your editor and project folder and update your SDK.
  4. Remove the ambient light from your scene and drag a new one in. Resave the scene as a different level and try to load that level.

 

good luck!

Link to comment
Share on other sites

You could temporarily rename the AmbientLight function in engine.cpp to make it cause compiler errors in places where you used the function.

Then you could find where you have used it.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Its not CEGUI.

 

Just from desperate, change

RenderFramework(); 

to

SetBuffer(_buffer);
RenderWorld();

//Render lighting
SetBuffer(BackBuffer());
RenderLights(_buffer);

 

got a strange picture, but now i can see ambient. I'll test simple level with framework and ambient, maybe problem is there.

Working on LeaFAQ :)

Link to comment
Share on other sites

Looking like its really Framework bug.

 

Can somebody else try this?

 

Initialize() ;
RegisterAbstractPath("../Assets/");
SetAppTitle( "Racing" ) ;
Graphics( 800, 600 ) ;
AFilter() ;
TFilter() ;


TBuffer gbuffer;
TCamera camera;
TMesh   mesh;
TLight  light;
TMesh   ground;
TMaterial material;


TFramework framework=CreateFramework();
TLayer layer = GetFrameworkLayer(0);
camera=GetLayerCamera(layer);

TEntity _scene = LoadScene("abstract::underground.sbx");

//PositionEntity(camera,Vec3(0,0,-2));

TEntity playerStart = FindChild(_scene,"playerstart_1");
PositionEntity(camera, EntityPosition(playerStart) + Vec3(0.0, 1.0, 0.0));

//Set Lua variable
BP L=GetLuaState();
lua_pushobject(L,framework);
lua_setglobal(L,"fw");
lua_pop(L,1);


// Game loop
while( !KeyHit() && !AppTerminate() )
{
	if( !AppSuspended() ) // We are not in focus!
	{

		// Update timing and world
		UpdateFramework();

		// Render
		RenderFramework();

		// Send to screen
		Flip(0) ;
	}
}

 

Its just standard template, underground.sbx is level with some tunnels, one point light and one ambient light.

When i tried with RenderWorld and so on - i saw ambient light and point light, but now i can see only point light.

 

Also, even when i add AmbientLight(Vec3(1)); before main loop, i also cannot see ambient.

So, looking like framework dont render world for ambients. (maybe this is not planned?)

Working on LeaFAQ :)

Link to comment
Share on other sites

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...