Jump to content

omid3098

Members
  • Posts

    375
  • Joined

  • Last visited

Posts posted by omid3098

  1. now it works using this code:

    require("Scripts/class")
    require("Scripts/constants/keycodes")
    require("Scripts/hooks")
    local class=CreateClass(...)
    function class:CreateObject(model)
    local object=self.super:CreateObject(model)
    function object:Update()
     if KeyDown(KEY_UP)==1 then
      CameraZoom(fw.main.camera,0.5)
     end
     if KeyDown(KEY_DOWN)==1 then
      CameraZoom(fw.main.camera,1.0)
     end
    end
    function object:Free()
     self.super:Free()
    end
    end
    

    • Upvote 1
  2. Programmer is doing bugfix since more than 2 months and I don't have permission to access him.

     

    this is my CameraManager.lua:

    require("Scripts/class")
    require("Scripts/constants/keycodes")
    require("Scripts/hooks")
    local class=CreateClass(...)
    function class:CreateObject(model)
    local object=self.super:CreateObject(model)
    --object.cameraFOV = CameraZoom(camera,1.0)
    SetFarDOFRange(2,5)
    SetFarDOFStrength(1)
    SetFarDOF(1)
    function object:DHook()
     -- Test if keys are working
     if KeyDown(KEY_U)==1 then
      SetFarDOF(1)
     end
     if KeyDown(KEY_Y)==1 then
      SetFarDOF(0)
     end
    end
    AddHook("Flip" , object.DHook )
    function object:Free()
     RemoveHook("Flip" , object.DHook )
     self.super:Free()
    end
    end
    

     

    I can enable/Disable DOF with keys but I have no Ideas how to access camera FOV.

  3. Hi. I am trying to control camera FOV using two keys in Lua (to increase and decrese) but I cant access to main Camera FOV.

     

    I have a CameraManager node in the scene and the code is something like this:

     

    require("Scripts/class")
    require("Scripts/constants/keycodes")
    require("Scripts/hooks")
    
    local class=CreateClass(...)
    
    function class:CreateObject(model)
    function object:DHook()
    if KeyDown(KEY_U)==1 then
    CameraZoom(45.0) -- or what? how should I use CameraZoom? 
    end
    end
    AddHook("Flip" , object.DHook )
    function object:Free()
    RemoveHook("Flip" , object.DHook )
    self.super:Free()
    end
    end
    

     

    there were CameraZoom(cam,value) in the forum but I dont know what is cam or how I can create that to use Camera zoom. actually tried cam=fw.main.camera but that is for framework I think.

     

    I did not write other parts of this code and also I don't have access to our programmer.

    and I'm not dump smile.png

    thanks before

  4. It is a keyframe motion. and there is no need to code for animating them. cuz I check animation in model viewer. (however I used LoadAnimation to check results in editor but there is no different)

    when both blades are in the same view, one of them will rotate around another and if there were one blade in viewport it will rotate correctly. so I thought the problem should be in shader/material.

    The only change I've made is that I removed zsort form materials. and this is why I'm curious about this.

  5. wiki says:

    zsort:

    If set to 1, the surface will be sorted with other z-sorted object in the scene. Sorted objects will be drawn last, from back to front. Use this setting with transparency.

    I can't understand what this means.

    what are z-sorted objects?

     

    the reason I ask is that when I have two animated elements into a single model (key-frame animation), always one of them will animate around another one.

    in this picture:

    post-50-0-06613300-1350579220.jpg

    the front blade should rotate along it's green axis. and the back blade should rotate along its red axis. but when we animate them, the front blade rotates around the back one:

    post-50-0-59697600-1350579210.jpg

     

    we used separate materials for each one. we even used separate textures(may look silly! but we did it), tried to export separate meshes and then animate them using LUA. we also checked .vert and .frag shaders (we have separate .vert and .frag for each material) but nothing changed.

    after we tried almost everything we understood that the problem is because of z-sort=1 in their materials.

    and by removing zsort=1 from materials, the problem solved.

     

    so. what exactly z-sort does. (please explain in an example)

  6. @frank: yes, that tutorial describes the best way. and in lower case we should disable shadows. but it affects only in game mode when we have dynamic objects. while the problem here is adding point lights only for static objects. so if you change those light types, no change will be happen.

  7. actually I checked those methods and as I told in first post, the best way so far is to use spotlight and shadowless point lights.

    but there should be another way to use point lights or modified point lights.. maybe :-??

  8. As you probably know, adding 3-4 point light eats many FPS (98 to 48 in my test scene) even if they are static lights.

    so doing lighting for interior scenes should be little tricky.. and I need some help here.

    here is what I've collected so far:

     

    - Disabled shadow lights: we need some point lights with disabled shadow to use as local ambient lighting. will not get much FPS(48 to 49) but its better than nothing

    - if is possible, use spotlight instead of point light in some places

     

    one more thing, all occlusion culling are enabled, average rendered polygons are almost 12k but rendered shadows are 140k is this normal?

     

    any other tips on lighting please?

  9. I don't think it's only because of LOD changing and for bbox movements I think we handled that by moving entire model with physic body. (I may be wrong so wait until Soamp reply himself)

    we don't use LOD for out FPS character and you can see in this video when FPS will be hide no matter if we are near or far from models.

    there are two separate characters in the video. the left one has only a CameraPivot inside(check the attached file) and the right one do not have CameraPivot inside which

    you see it do not hide in this case because of an additional hieratchy ( :blink: ). well, we thought we have to use that one (the right one) so we exported the CameraPivot as a separate file and moved that to the right place as it should be. by loading motion on the character, still there is no problem, but when we move camera on the camera pivot with the correct direction to look forward this hand will be hide too.

     

    so we must figure out when engine decides to hide a model.

     

    Attachment file contains both FPS characters. the idle motion for the right character, and the CameraPivot model.

    Test_FPS.zip

×
×
  • Create New...