Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-03-11, 22:36


PenkY

Mapper






Wiek: 24
Na forum: 3606 dni
Posty: 223
Nick w MP: penky

Piwa: 2225

Respekt: 472
Respekt: 472

Witam!

Ot?? wgra?em sobie taki Panel Logowania w kt?rym jest potrzebny Blur i nie wiem dlaczego.. gdy odpalam tego Blura kt?ry by? do??czony do Panelu Logowania to mi zacina.. kompletnie nie rozumiem. Warningi ci?gle wywala w DB 3. M?g?bym prosi? o pomoc? Stawiam :piwo: oraz R*

SS z DB3: http://prntscr.com/ipucn7

Podpis
Discord: p3nky.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-11, 22:42


Szydlo

Stance Works






Wiek: 26
Na forum: 3726 dni
Posty: 343
Nick w MP: Szydlo

Piwa: 4

Respekt: 105,3
Respekt: 105,3

PenkY., To jest podstawowy angielski, jak nie rozumiesz to sobie przet?umacz w t?umaczu, by? mo?e poda? kod?

Podpis
Aktualny najlepszy kontakt do mnie: Szydlo#8134 (Discord)
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-11, 22:48


PenkY

Mapper






Wiek: 24
Na forum: 3606 dni
Posty: 223
Nick w MP: penky

Piwa: 2225

Respekt: 472
Respekt: 472

Szydlo, Jestem pocz?tkuj?cy w Lua a Angielskiego za bardzo nie umiem a wiem ?e s? to podstawy :)


local scx, scy = guiGetScreenSize()

Settings = {}
Settings.var = {}
Settings.var.blur = 1
Settings.var.optim = 4 -- dzieli rozdzielczo?? w efekcie mniejsza ilosc pixeli do renderowania (nieco psuje jakosc)
Settings.screenRectangle = {}

local current

function createShader()
        if getVersion ().sortable < "1.1.0" then
            outputChatBox( "Resource is not compatible with this client." )
            return
        end
        myScreenSource = dxCreateScreenSource( scx/Settings.var.optim, scy/Settings.var.optim )
        blurHShader,tecName = dxCreateShader( "shaders/blurH.fx" )
        blurVShader,tecName = dxCreateShader( "shaders/blurV.fx" )
        bAllValid = myScreenSource and blurHShader and blurVShader
        if not bAllValid then
            outputChatBox( "Could not create some things. Please use debugscript 3" )
        end
end
createShader()



function blur_createBlurRenctagle(bool)
    if bool then
            Settings.screenRectangle = {pos_x, pos_y, size_x, size_y}
            createShader()
            addEventHandler( "onClientHUDRender", root,    blur_render2)
        else
        if isElement (blurHShader) and isElement (blurVShader) then
            Settings.screenRectangle = {}
            destroyElement (blurVShader)
            destroyElement (blurHShader)
        end
        removeEventHandler( "onClientHUDRender", root,    blur_render2)
    end
end

function preRender ()
    if not Settings.var then
        return
    end
    RTPool.frameStart()
    dxUpdateScreenSource( myScreenSource )
    current = myScreenSource
    current = applyGBlurH( current, Settings.var.blur )
    current = applyGBlurV( current, Settings.var.blur )
    dxSetRenderTarget()
end
addEventHandler ("onClientRender", root, preRender)

function dxDrawBluredRectangle (pos_x, pos_y, size_x, size_y, color)
     if bAllValid and current then
        dxDrawImageSection ( pos_x, pos_y, size_x, size_y, pos_x/Settings.var.optim, pos_y/Settings.var.optim, size_x/Settings.var.optim, size_y/Settings.var.optim, current, 0,0,0, color)
     end
end

-----------------------------------------------------------------------------------
-- Apply the different stages
-----------------------------------------------------------------------------------
function applyGBlurH( Src, blur )
    if not Src then return nil end
    local mx,my = dxGetMaterialSize( Src )
    local newRT = RTPool.GetUnused(mx,my)
    if not newRT then return nil end
    dxSetRenderTarget( newRT, true )
    dxSetShaderValue( blurHShader, "TEX0", Src )
    dxSetShaderValue( blurHShader, "TEX0SIZE", mx,my )
    dxSetShaderValue( blurHShader, "BLUR", blur )
    dxDrawImage( 0, 0, mx, my, blurHShader )
    return newRT
end

function applyGBlurV( Src, blur )
    if not Src then return nil end
    local mx,my = dxGetMaterialSize( Src )
    local newRT = RTPool.GetUnused(mx,my)
    if not newRT then return nil end
    dxSetRenderTarget( newRT, true )
    dxSetShaderValue( blurVShader, "TEX0", Src )
    dxSetShaderValue( blurVShader, "TEX0SIZE", mx,my )
    dxSetShaderValue( blurVShader, "BLUR", blur )
    dxDrawImage( 0, 0, mx,my, blurVShader )
    return newRT
end


-----------------------------------------------------------------------------------
-- Pool of render targets
-----------------------------------------------------------------------------------
RTPool = {}
RTPool.list = {}

function RTPool.frameStart()
    for rt,info in pairs(RTPool.list) do
        info.bInUse = false
    end
end

function RTPool.GetUnused( mx, my )
    -- Find unused existing
    for rt,info in pairs(RTPool.list) do
        if not info.bInUse and info.mx == mx and info.my == my then
            info.bInUse = true
            return rt
        end
    end
    -- Add new
    local rt = dxCreateRenderTarget( mx, my )
    if rt then
        RTPool.list[rt] = { bInUse = true, mx = mx, my = my }
    end
    return rt
end


Podpis
Discord: p3nky.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-12, 08:37


Kalizman







Wiek: 24
Na forum: 3793 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Ten blur czasami tak ma, kiedy? go u?ywa?em, ale to jak mia? dobry nastr?j to poprawnie dzia?a?, a nie raz spami?o z DB3 i by?em zmuszony wy??czy? blur.

Sprawdza?e? zmieniaj?c warto?ci w kodzie od blur?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-12, 08:55


Ciastuuś

As-salamu alaykum






Wiek: 27
Na forum: 3212 dni
Posty: 800
Nick w MP: Ciastuuś

Piwa: 4304

Respekt: 640
Respekt: 640Respekt: 640

Je?eli posiadasz ten skrypt z community to musisz liczy? si? z tym, ?e ma b??dy z powod?w nieznanych. Je?eli chcesz pode?l? Ci taki co u?ywaj? wszyscy i nie powiniene? mie? z nim najwi?kszych problem?w

Podpis
As-salamu alaykum
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-13, 19:05


PenkY

Mapper






Wiek: 24
Na forum: 3606 dni
Posty: 223
Nick w MP: penky

Piwa: 2225

Respekt: 472
Respekt: 472

Ciastuu?, Je?eli mo?esz to bardzo bym prosi? ;)

Podpis
Discord: p3nky.
Postaw piwo autorowi tego posta
 

 
Tagi: blur :: panel :: logowania :: zacina
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku