Jump to content

Error with SSAO


Gilmer
 Share

Recommended Posts

To use the SSAO, is need put some command? Im using the SetSSao(1), and when debuggin, are crashing. I update to 2.4..

 

My code is this:

 

#include "engine.h"
#include "math.h"

int main( int argn, char* argv[] )
{
Initialize() ;
RegisterAbstractPath("D:\Projetos\safari\data");
SetAppTitle( "Safari" ) ;
Graphics( 1280,768,32) ;
AFilter(16) ;
TFilter() ;

TWorld	world;
TMesh	mesh;
TLight	light;
TMesh	ground;
TMaterial material;

world = CreateWorld() ;
if (!world) {
	MessageBoxA(0,"Error","Failed to create world.",0);
	return Terminate();
}

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


//CAMERA
PositionEntity(camera,Vec3(-24.54,2,-13.88));
RotateEntity(camera,Vec3(0,-60,0));
float zoom=1.0/tan(115/2.0);
CameraZoom(camera,zoom);

//Load Map
LoadScene("abstract::safari.sbx");

//SkyBox
SetSkybox(LoadMaterial("abstract::safarisky.mat"));
SetBackgroundColor(Vec4(1,1,1,1));

light=CreateDirectionalLight();
RotateEntity(light,Vec3(21.23,159.54,3.61));
AmbientLight(Vec3(0.5,0.43,0.34));
EntityColor(light,Vec4(0,0,0,1.5));

SetDistanceFog(1);
SetDistanceFogRange(0,200);
SetDistanceFogColor(Vec4(0.99,0.93,0.81,1));
SetDistanceFogAngle(0,15);


//fx
SetGodRays(1);
SetHDR(1);
SetBloom(1);

//THE ERROR IS HERE
//SetSSAO(1);


SetAntialias(1);
SetVegetationShadowMode(1);


TMesh zebra=LoadMesh("abstract::safari_animals_zebra.gmf");
PositionEntity(zebra,Vec3(-9.79,0.24,-12.98));

TMesh elefante=LoadMesh("abstract::safari_animals_elephant.gmf");
PositionEntity(elefante,Vec3(-22.91,0,-10.21));



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

		// Update timing and world
		UpdateAppTime();
		UpdateWorld(AppSpeed()) ;

		// Render
		UpdateFramework();
		RenderFramework();

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

// Done
return Terminate() ;
}

Link to comment
Share on other sites

You are creating a world which you don't need. Framework creates all worlds.

You have to check that you have the newest shaders.pak in your project also.

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

I was having an issue like this when I was setting up my current project... to fix it I believe I had to copy over the Materials folder to my projects content directory and it started working, this was in addition to copying over the shaders.pak and script folder.

Link to comment
Share on other sites

Also .. try checking the log file thats generated by your app in your apps directory, lots of info in there to help debugging, including things your app could not load because it could not find them.

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