Jump to content

Framework + LEO - Unable to get shadows


Scott Richmond
 Share

Recommended Posts

I'm a bit annoyed at myself for not being able to work this out, but why is it that the code pasted below will not give me lighting (other than ambient) and shadows?

Note: The testMap I am loading works fine in the editor.

 

Game::Game() {

/***********************************************************************
ENGINE INITIALIZATION
***********************************************************************/
//setGameState(GAMESTATE_INITIALIZING); // NOT IN USE YET
scroll_speed = 0.5;

engine.Create("HiveMind Keeper v0.01", 800, 600, 0, 60);
engine.SetAbstractPath("./Data");
engine.SetFilters(4, 1);
engine.SetShadowQuality(DEEPSHADOW);
world.Create();
framework.Create();
layer = framework.GetLayer(0);

framework.GetRenderer().SetAntialias(1);
framework.GetRenderer().SetBloom(1);
framework.GetRenderer().SetGodRays(1);
framework.GetRenderer().SetHDR(1);
framework.GetRenderer().SetSSAO(1);
framework.SetStats(2);

// Must do this to allow LUA to access them.
SetGlobalObject ("fw",					framework);
SetGlobalObject ("world_main",			framework.main.GetWorld());
SetGlobalObject ("world_transparency",	framework.transparency.GetWorld());
SetGlobalObject ("world_background",	framework.background.GetWorld());
SetGlobalObject ("camera_main",			framework.main.GetCamera());
SetGlobalObject ("camera_transparency", framework.transparency.GetCamera());
SetGlobalObject ("camera_background",	framework.background.GetCamera());

level.buildMap(); // Load test map. 
lastSelectedEntity = level.playerPivot; // Need to init this otherwise we'll crash.

camrotation=Vec3(0);
mx=0;
my=0;

/***********************************************************************
GAME LOOP
***********************************************************************/
while( !engine.IsTerminated() )
{
	if( !engine.IsSuspended() )				// Don't do anything if we are not in focus.
	{
		framework.Update();
		framework.Render();
		engine.Flip(1);

		updateInput();						// Check for input and act accordingly.
	}
}

/***********************************************************************
CLEAN UP
***********************************************************************/
engine.Free();
}

 

BuildMap Function:

void Level::buildMap() {
LoadScene("abstract::TestMap.sbx");

//Actor testGuy(PAWN, Vec3(4, 1, 0), 100);

playerPivot.Create();
playerCamera.Create();
playerCamera.SetParent( playerPivot );

setCameraType(1);
}

Programmer, Modeller

Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64

Visual Studio 2008 | Photoshop CS3 | Maya 2009

Website: http://srichnet.info

Link to comment
Share on other sites

Seems that you are not setting the fw variable. See gamelib's TGame::Initialize() method how to set it:

luat.Create();						// create the LuaTools object
luat.SetScriptObject("fw",scene.framewerk);		// set the Lua variable fw

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

Doesn't this line do the same thing?

SetGlobalObject ("fw", framework);

 

Also, where's the documentation on this?

No, that only sets an object called fw, it's not the same as a Lua variable.

I don't think this is documented in the Wiki yet, but you find several examples which do this.

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

Ok, well I've set that up now for use in LEO/Framework:

	lua.Create();
int luaSize = lua.GetTop();
lua.PushObject(framework);
lua.SetGlobal("fw");
if( luaSize - lua.GetTop() )
	lua.Pop( lua.GetTop() - luaSize );

 

Still no luck. Incidently the windwill no longer animates or emits sound anymore. There has got to be something much more simple wrong here. Ideas?

Programmer, Modeller

Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64

Visual Studio 2008 | Photoshop CS3 | Maya 2009

Website: http://srichnet.info

Link to comment
Share on other sites

The windmill uses the old Lua script and as far as I know is no longer in the SDK DL.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

The windmill uses the old Lua script and as far as I know is no longer in the SDK DL.

Really? Why? Not that it matters, the lua script is sitting in the model folder in my project folder. So all should be well.

Programmer, Modeller

Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64

Visual Studio 2008 | Photoshop CS3 | Maya 2009

Website: http://srichnet.info

Link to comment
Share on other sites

let me rephrase - The windmill uses the old Lua script and as far as I know The windmill model is no longer in the SDK DL.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Ah fantastic. Thanks Lumooja. The Windmill now works fine. But still no lighting. I've even integrated the LuaTools function of yours from this post: http://leadwerks.com/werkspace/index.php?/topic/431-2-3-sync/page__view__findpost__p__5053

 

Sort of running out of ideas. Right now I'm doign a force update of the SDK and will see how that goes.

Programmer, Modeller

Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64

Visual Studio 2008 | Photoshop CS3 | Maya 2009

Website: http://srichnet.info

Link to comment
Share on other sites

Thanks for taking the time to check this out Lumooja. FYI - The lighting works fine in-editor.

 

Model {
path="light_directional.gmf"
position=0.000000000,1.00000000,0.000000000
rotation=45.0000000,34.9999924,3.12794646e-006
scale=1.00000000,1.00000000,0.999999940
id=211208536
"aligntoground"="0"
"class"="Model"
"collisiontype"="0"
"damping"="0.000000000,0.000000000"
"friction"="0.000000000,0.000000000"
"gravity"="0"
"intensity"="1.0000000000000000"
"linearoffset"="0.310000002,0.400000006,0.699999988"
"mass"="0.00000000000000000"
"name"="light_directional_1"
"order"="0"
"range"="500.00000000000000"
"reloadafterscript"="1"
"resolution"="2"
"shadowdistance"="6.00000000,20.0000000,100.000000"
}

Programmer, Modeller

Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64

Visual Studio 2008 | Photoshop CS3 | Maya 2009

Website: http://srichnet.info

Link to comment
Share on other sites

Try adding castshadows here for the light_directional.gmf:

 

	"aligntoground"="0"
"castshadows"="1"
"class"="Model"
"collisiontype"="0"

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

have you got the scripts folder copied to your appdir?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

no errors in the log file? if your abstract path is to the appdir have you copied over the entities folder?

 

sorry just throwing things out there really.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

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