Jump to content

Dreikblack

Members
  • Posts

    341
  • Joined

  • Last visited

Posts posted by Dreikblack

  1. 11 hours ago, Josh said:

    I have not yet added functionality to "break" prefabs, which would turn an object from a prefabs into a regular non-prefab object that gets stored in the map.

    Yeah, probably it should be enough. Currently prefabs are just useless if i need to change anything in component values.

  2. cam2:SetUniform(1, "Thickness", 4);

     

    -- Get the displays
    local displays = GetDisplays()
    
    -- Create a window
    local window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[1], WINDOW_CENTER | WINDOW_TITLEBAR)
    
    -- Create a world
    local world = CreateWorld()
    
    -- Create a framebuffer
    local framebuffer = CreateFramebuffer(window)
    
    -- Create a camera
    local camera = CreateCamera(world)
    camera:SetClearColor(0.125)
    camera:SetPosition(0, 0, -2)
    
    -- Create a light
    local light = CreateBoxLight(world)
    light:SetRotation(45, 35, 0)
    light:SetRange(-10, 10)
    light:SetColor(2)
    
    -- Create a model
    local model = CreateBox(world)
    model:SetColor(0, 0, 1)
    model:SetRenderLayers(1 + 2)
    
    local cam2 = CreateCamera(world);
    cam2:SetClearColor(0, 0, 0, 0);
    cam2:SetRenderLayers(2);
    cam2:SetFov(camera:GetFov());
    cam2:SetMatrix(camera:GetMatrix());
    cam2:AddPostEffect(LoadPostEffect("Shaders/Outline.fx"));
    cam2:SetUniform(1, "Thickness", 4); -- ERROR HERE
    local sz = framebuffer:GetSize();
    local texbuffer = CreateTextureBuffer(sz.x, sz.y);
    cam2:SetRenderTarget(texbuffer);
    -- Display overlay
    local sprite = CreateSprite(world, sz.x, sz.y);
    local color = Vec4(0, 1, 0, 1);
    sprite:SetColor(color);
    sprite:SetRenderLayers(4);
    local mtl = CreateMaterial();
    sprite:SetMaterial(mtl);
    mtl:SetTransparent(true);
    mtl:SetTexture(texbuffer:GetColorAttachment());
    local cam3 = CreateCamera(world, PROJECTION_ORTHOGRAPHIC);
    cam3:SetClearMode(CLEAR_DEPTH);
    cam3:SetRenderLayers(4);
    cam3:SetPosition(sz.x * 0.5, sz.y * 0.5, 0);
    
    -- Main loop
    while not window:Closed() and not window:KeyDown(KEY_ESCAPE) do
        model:Turn(0, 1, 0)
        world:Update()
        world:Render(framebuffer)
    end

     

  3. 8 minutes ago, SpiderPig said:

    Maybe the shader needs to be applied to the mask section of the shader family as well?

    Same result. Not sure if i did it right tho
     

    {
    	"shaderfamily":
    	{
    		"root": "Shaders/PBR.fam",
    		"static":
    		{
    			"float": {
    				"opaque": {
    					"default": {
    						"base": {
    							"vertex": "Shaders/PBR/PBR.vert",
    							"fragment": "Shaders/Editor/Stipple.frag"
    						}
    					}
    				},
    				"mask": {
    					"default": {
    						"base": {
    							"vertex": "Shaders/PBR/PBR.vert",
    							"fragment": "Shaders/Editor/Stipple.frag"
    						}
    					}
    				}
    			}
    		}
    	}
    }

     

  4. Model just became invisible with it. What am i doing wrong?

    #include "UltraEngine.h"
    
    using namespace UltraEngine;
    
    int main(int argc, const char* argv[])
    {
        //Get the displays
        auto displays = GetDisplays();
    
        //Create a window
        auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);
    
        //Create a world
        auto world = CreateWorld();
    
        //Create a framebuffer
        auto framebuffer = CreateFramebuffer(window);
    
        //Create a camera
        auto camera = CreateCamera(world);
        camera->SetClearColor(0.125);
        camera->SetPosition(0, 0, -4);
    
        //Create a light
        auto light = CreateBoxLight(world);
        light->SetRotation(45, 35, 0);
        light->SetRange(-10, 10);
        light->SetColor(2);
    
        //Create a model
        auto model = CreateBox(world);
        model->SetColor(0, 0, 1, 0.5f);
        auto strippleMaterial = CreateMaterial();
        ChangeDir(AppDir());
        auto strippleShader = LoadShaderFamily("Shaders/Editor/Stipple.fam");
        strippleMaterial->SetShaderFamily(strippleShader);
        model->SetMaterial(strippleMaterial);
    
        //Main loop
        while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
        {
            world->Update();
            world->Render(framebuffer);
        }
        return 0;
    }

     

  5. Changes for last month:

    - New special shot for Shotgun - aimed shot (bigger distance and damage but only for single target)
    - Now in a first round only a first team have action and movement points
    - Outline thickness setting
    - Outline optimization which increased FPS a lot
    - Different color for LoS lines when target is flanked
    - No camera moving by cursor if it’s on GUI or in menu
    - Camera movement with RMB and rotation with MMB
    - Load Map button to play any map regardless difficulty setting
    - Codex with tutorials, weapons and enemies
    - Mini Codex with current points for enemy can be opened with MMB on them
    - Inventory opening for Marine that under cursor with MMB
    - Showing now max action distance with red circle for enemy that under cursor
    - Showing potential tiles to go for enemy when cursor on them
    - Glowing and sound when targeting a tile
    - Which team turn now shown at top
    - Current weapon name above weapon bar

     

    • Like 2
  6. I did not noticed significant issues with current FPS limit implementation so it was already better than nothing.

    Beside 500 Hz 360 and 240 screens are also a thing. Also VSync adds an input lag which is crucial for action games, especially for multiplayer ones.

    Even for g-sync fps limiter needs to be to eliminate input lag (to make it lower by 3 then screen hz - 141 if 144 etc).

    • Like 1
    • Upvote 1
  7. 1. Create brush

    2. Select face.

    3. Apply texture:

    local texture = LoadTexture("/Materials/Developer/trigger.dds")
    local material = CreateMaterial()
    material:SetTexture(texture)
    local faces = program.facepanel:GetSelectedFaces() 
    			if (#program.facepanel:GetSelectedFaces() > 0) then
    				for n = 1, #faces do
    					local currentFace = faces[n]
    					if currentFace ~= nil then
    						currentFace:SetMaterial(material)
    						currentFace:GetBrush():Build()
    					end  
    				end	
    				return
    			end

    4. Select other face and apply other texture:

    local texture = LoadTexture("/Materials/Developer/grid01.dds")
    local material = CreateMaterial()
    material:SetTexture(texture)
    local faces = program.facepanel:GetSelectedFaces() 
    			if (#program.facepanel:GetSelectedFaces() > 0) then
    				for n = 1, #faces do
    					local currentFace = faces[n]
    					if currentFace ~= nil then
    						currentFace:SetMaterial(material)
    						currentFace:GetBrush():Build()
    					end  
    				end	
    				return
    			end

    5. Save map and open again

    image.png.bae81a0489cb200e2828fd976ed40c33.pngMaps.zip

    Same for prefabs

    Also editor starts behave clunky after that - slow with delays and freezes

×
×
  • Create New...