Jump to content

shadmar

Members
  • Posts

    3,618
  • Joined

  • Last visited

Posts posted by shadmar

  1. This is a c++ snip that inits lua and loads a scene containg road/river/lights etc.. correctly, but not sure if it's that you need (or I didn't understand the question)

     

    #include "engine.h"
    
    int main(int argc, char** argv)
    {
    	Initialize();
    	RegisterAbstractPath("C:Leadwerks Engine SDK");
    	Graphics(1280,960);
    
    	AFilter() ;
    	TFilter() ;
    
    	TFramework framework=CreateFramework();
    	TLayer layer = GetFrameworkLayer(0);
    	TCamera cam=GetLayerCamera(layer);
    	PositionEntity(cam,Vec3(0,0,0));
    
    	//Set Lua variable
    	BP L=GetLuaState();
    	lua_pushobject(L,framework);
    	lua_setglobal(L,"fw");
    	lua_pop(L,1);
    
    	// Setup Initial Post Processing FX
    	//SetGodRays(1);
    	SetHDR(1);
    	SetSSAO(1);
    	SetBloom(1);
    	SetAntialias(1);
    	SetStats(2);
    
    	LoadScene("abstract::riverscene.sbx");
    
    	// Setup spectator
    	TBody spectator=CreateBodySphere();
    	SetBodyMass(spectator,1);
    	SetBodyGravityMode(spectator,0);
    	SetBodyDamping(spectator,1.0);
    	EntityType(spectator,3);
    	SetBodyBuoyancyMode(spectator,0);
    	PositionEntity(spectator,Vec3(0,5,-10));
    
    	TVec3 camrotation=Vec3(0);
    	float mx=0;
    	float my=0;
    	float move=0;
    	float strafe=0;
    
    	HideMouse();
    	MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
    
    	// MAIN LOOP
    	while (!KeyHit(KEY_ESCAPE))
    	{
    
    	mx=Curve(MouseX()-GraphicsWidth()/2,mx,6);
    	my=Curve(MouseY()-GraphicsHeight()/2,my,6);
    	MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
    
    	camrotation.X=camrotation.X+my/10.0;
    	camrotation.Y=camrotation.Y-mx/10.0;
    	RotateEntity(cam,camrotation);
    
    	move=KeyDown(KEY_W)-KeyDown(KEY_S);
    	strafe=KeyDown(KEY_D)-KeyDown(KEY_A);
    	TVec3 force = Vec3(strafe*10.0,0,move*10.0);
    	force=TFormVector(force,cam,0);
    	AddBodyForce(spectator,force);
    
    	PositionEntity(cam,EntityPosition(spectator));
    
    	// Update timing and world
    	UpdateFramework();
    
    	// Render
    	RenderFramework();
    
    	// Send to screen
    	Flip(0) ;
    	}
    
    	return Terminate();
    }

  2. Will there be a "Play Game" button aswell in that editor? With the option to change game script like we have now.

    Can we edit mat files from the editor and reload material? (without having to restart editor)

    Could we have an edit current vert/frag button too?

  3. If the shaders we use in LE2 are usable in LE3 you won't really notice any worse graphics.

    The AAA look is just shaders and textures. Gameengine provides gamelogic and shaderinput, shaders and textures provides eyecandy for our games.

    I take it that the shaders won't be reusable since we get abit "worse" graphics.

    But I hope we still can use custom shaders in LE3?

  4. You still have to have the mesh in the transparency world when using shaders.

    So assuming you are using fw, it should go someting like this (not tested)

     

    SetWorld(fw.transparency.world)
    model = LoadMesh("abstract::model.gmf")
    SetWorld(fw.main.world);
    
    myfade=0;
    material=LoadMaterial("abstract::"))
    shader=GetMaterialShader(material)
    
    
    

     

    In your run loop :

     

    myfade=myfade+0.001
    SetShaderFloat(shader,"myfade",myfade)
    
    

     

    In mat file have

     

    blend=alpha

     

    In your shader (frag file)

     

    add before main():

    uniform float myfade=0.0;

     

    find : gl_FragData[0] = diffuse;

     

    Add below

     

    gl_FragData[0].a-=clamp(myfade,0,1);

     

     

    It should now alpha fade by 0.001 per flip() (in theory)

  5. Mike is right on the money, Editor makes my life easy (atleast), so design levels and setup smart lua objects in the editor and load the scene using whatever language you want to run your game code in (c++ / pascal etc..) including all libs you need etc.. Or just use lua for everything.

  6. Zombie killing spree idea, simple game idea :

    1. How many can you kill before you are totally overrrun and killed. Get score on kills.

    2. Or can you get from A to B alive in X minutes, get score on time and kills, pickup weapons on the way. (this will be doable in many levels as you increase range and shorten time or both)

  7. I like UU3D, not sure how I would get by without (haven't tried the sdk tools yet), I'm using several engines so unwrapping and model conversions / exporting are all done in UU3D

  8. If you look at this tutorial (for the editor.. scroll almost all the way down)

    http://www.leadwerks.com/werkspace/page/articles/_/programming/transparency-and-refraction-r10

     

    I get wierd refraction that refracts items in front of the refracted object and therefore itself like a mirror mirroring a mirror,,, (i've toned down bump so its easier too see)

     

    LE_refrbug1.jpg

     

    I also trid this workaround, but no luck : http://www.leadwerks.com/werkspace/topic/964-transparency-and-refraction-tutorial/page__p__9112#entry9112

     

    Any help appreciated..

  9. Hi

     

    Will LE3D have such a functionality so we can have realtime cubemaps done in lua ?

    As I understand after reading several posts, we can't do realtime cubemaps in LE2 (lua) because cubemaps generated from FBO doesn't have any mipmaps. (renders black) which ruins my fun :)

     

    Or just the same, will it be possible to do realtime cubemaps in LE3D in lua (without using opengl directly via c++ as klepto2 has done).

     

    Don't get me wrong, I like c++ just as much as the next guy, but I like using the editor and have smart lua objects.

×
×
  • Create New...