Jump to content

VeTaL

Members
  • Posts

    1,272
  • Joined

  • Last visited

Everything posted by VeTaL

  1. Anyway, when i use RenderWorld - UpdateWorld, i see ambient without direct light: my scene have only one source of ambient light and one source of point light.
  2. I need directional light to use ambient light? Strange indeed, because if i would have indoor level (like inside tunnels), i dont need directional light.
  3. If looking from youtube, its okay with code size, i think. On the other hand, it would be nice if you would add CubeSpeed parameter, so we would be able to see speed of cube before using AppSpeed in different resolutions, and after.
  4. Also, i tested http://leadwerks.com/werkspace/index.php?/topic/381-scene-loading-example/page__p__5623#entry5623 but the result is the same: no ambient light, only spot.
  5. 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?)
  6. Hey, you're back How is your IK project? You worked on blending, as i remember?
  7. And what about animation: i cn share my code (probably its not a new for Aggror, but anyway, it can be usefull for others) Inside main loop: float CurrentTime = AppTime(); _deltaTime = (CurrentTime - _elapsedTime) * 0.001f; Inside animation loop: _desiredAnimationFPS = _weaponAnimation->GetAnimationSpeed(); float dframe = _desiredAnimationFPS * _deltaTime; dframe = Clamp(dframe, 0.000, 1.50); dframe = dframe * ( 1 + 0.6 * (_currentAnimationSegment->getName() == "run") + 0.5 * (_currentAnimationSegment->getName() == "fire")); In this case, if we need to play animation 20 frames per second and we have 40 fps, we would play 0.5 animation frame per game frame. If we would have 20 game fps, animation would be updated by 1 animation frame per game frame.
  8. In simple demo with framework its okay with ambient... looking like i need to refactoring my project class by class and see, what happened.
  9. 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.
  10. I do that last night: no errors while recompile. I also shut down HDR and all posteffects - result is the same. Got an idea that this can be caused by CEGUI, because in other project, that used the same assets ambient is okay.
  11. Looking like this trouble is only in my current project: i added another simple project, load the same settings and the same map there and i see ambient light.... But i cant find any line of code, connected to ambients. Strange indeed.
  12. Great, ArBuZ, on the first sight this is right what i need... I'll look into it deeper.
  13. I tried it on different maps: direct, spot and point lights work good in game, but not ambient.
  14. Just deleted my Entities project folder and paste Entities from fresh 2.4 folder, add ambient light, set it to 0.3 + added player_info marker, because player placed here, and got still the same result: there is ambient light in Editor, but no in game.
  15. I know that there were a lot of talks about it, but i thought that i would be able to manage with threading code from here http://leadwerks.com/werkspace/index.php?/topic/2287-public-domainish-c-code/ I tried with creation another opengl context in another thread, but still no large progress now.
  16. 1. Of course, its all right in log file. 2. Nope, just one 3. Updating now. 4. Tried that, no results. Also, i noted that i cant see any ambient light in any level in game, in editor its allright. I'll try updated version now
  17. 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.
  18. Okay, i almost finished with terrains, so now is question where i'm stuck in (and looking like i missed it out previous time): how to load model from another thread, independent from gameplay?
  19. omid, thanks, thats good.
  20. Check your main loop, update and render functions.
  21. Okay, but can i add new method in LUA? For example, i want to inherit from existing entity, add some new methods and see them in C++ Looking like i need to add luabind?
  22. Some days ago, modeller asked if Leadwerks supports CAT-animations... idk, what to tell him btw, found this site about face animations, maybe somebody would be interested (this is russian site): http://art-ro.narod.ru/Master/Answer/31.htm
  23. Okay, just tested: for (int i=0; i<100; i+=1) { for (int j=0; j<100; j+=1) { // instancing cube = CopyEntity(cube); //// non-instancing //cube = CreateCube(); PositionEntity(cube, Vec3(i*2,0,j*2)); PaintEntity(cube, mat); } } CopyEntity() works fast enough CreateCube() very slooow LoadModel() also fast
  24. I noted that i have too little fps on the map with 30-40 wall models, the same number of tower models and 10-20 house models (in summary, about 100 entities). On the other hand, i remember my playing with instancing and also i remember post on this forum with 500K cubes. So, lets see: first, i procedurally generate map, and then i need to generate SBX file by my hands so i would be able to load level in editor or game. So the question is: how engine knows that this object (that is loading now) is instanced or not? I see two ways: 1) - while saving map into SBX, Editor puts in order models with the same name - while LoadMap, engine looks at the name of previous entity (because they are already categorized by name) and make CopyEntity if the names are the same 2) - engine just have list of all entities and while it loads new one, it checked by that list, and if entity already exists, it makes CopyEntity, if not - creates new one. So, generated file looking like this: Model { path="tower.gmf" position=35.75,0,35.75 rotation=0,0,0 scale=1,1,1 id=22979576 "class"="Model" "collisiontype"="2" "intensity"="1.0000000000000000" "name"="GeneratedModel_0" } Model { path="wall_large.gmf" position=30.25,0,35.75 rotation=0,0,0 scale=1,1,1 id=22979576 "class"="Model" "collisiontype"="2" "intensity"="1.0000000000000000" "name"="GeneratedModel_1" } Model { path="tower.gmf" position=24.75,0,35.75 rotation=0,0,0 scale=1,1,1 id=22979576 "class"="Model" "collisiontype"="2" "intensity"="1.0000000000000000" "name"="GeneratedModel_2" } Model { path="wall_large.gmf" position=19.25,0,35.75 rotation=0,0,0 scale=1,1,1 id=22979576 "class"="Model" "collisiontype"="2" "intensity"="1.0000000000000000" "name"="GeneratedModel_3" } Model { path="tower.gmf" position=13.75,0,35.75 rotation=0,0,0 scale=1,1,1 id=22979576 "class"="Model" "collisiontype"="2" "intensity"="1.0000000000000000" "name"="GeneratedModel_4" } Do i need to group it like "tower", "tower", "tower", "wall", "wall", "wall" for enabling instancing?
×
×
  • Create New...