Hello,
currently I'm trying to use the Global "DrawBloom" for clients, to edit the Bloom settings on them via Lua
My Code looks like this:
[CODE]function SayBloom(pl, text, txt, teamchat, dead)
if (string.sub(text, 1, 4) == "/blu") then
temp = "DrawBloom( 0, 0.75, 3, 3, 2, 3, 255, 255, 255 )"
BroadcastLua( temp )
-- return ""
end
end
hook.Add("PlayerSay", "SayBloom", SayBloom);[/CODE]
But it acctualy does nothing.
I even tryed using DrawBloom via lua_run_cl (it's a client function doe) in my Console
[CODE]lua_run_cl DrawBloom( 0, 0.75, 3, 3, 2, 3, 255, 255, 255 )[/CODE]
But that doesn't do anything, what I'm doing wrong?
New wiki doesn't provide this info, but it might be useful:
[quote]Additional Notes:
You usually want to use this from the "RenderScreenspaceEffects" hooked like in the example.
The best way to test for args is to play around with the sandbox implementation.
This won't work on graphics cards that don't support Pixel Shader 2.0.
The color values( r, g, b ) should be between 0 and 1. Values larger than 1 will exaggerate the effect.[/quote]
just to be sure your lua_run_cl is an accurate test just be aware of the following:
lua_run_cl is disabled by default.
sv_allowcslua 1
You may or may not already know this, but I'm just making sure.
[QUOTE=Netheous;43252443]New wiki doesn't provide this info, but it might be useful:[/QUOTE]
Acctualy, no.
I can't hook it via "RenderScreenspaceEffects", cause I need it to get called on an command.
Or is there a way to do both?
The rest is not realy important, atleast I think so. (Bloom does work at this Machine, args are correct, the rgb values are taken from the wiki)
You can use a variable boolean that the command flips from false to true.
Then in your RenderScreenspaceEffects hook function check if the bloom boolean is set to true, if so run the bloom logic, otherwise don't.
Introducing Pseudo-code
[CODE]
bMyBloom = false
function myRenderBloom()
if (bMyBloom) do
-- Draw bloom
end
end
function toggleMyBloom()
bMyBloom = !bMyBloom
end
[/CODE]
[QUOTE=Sorasan;43252493]Acctualy, no.
I can't hook it via "RenderScreenspaceEffects", cause I need it to get called on an command.
Or is there a way to do both?
The rest is not realy important, atleast I think so. (Bloom does work at this Machine, args are correct, the rgb values are taken from the wiki)[/QUOTE]
Well, you can make a clientside function and activate it using net library
[url]http://wiki.garrysmod.com/page/Net_Library_Usage[/url]
[QUOTE=JayneHJKL;43252480]
lua_run_cl is disabled by default.
sv_allowcslua 1
[/QUOTE]
Didn't know that, thanks.
It's working now, with console commands.
But it's weird.
It's extremly bright, can't even see anything ( now I get why the numbers shouldn't be over 1)
But, how should I select the Color of the Bloom effect then?
(Probaly possible by converting the RGB values from 255 to the 0-1 range, isn't it?)
It's Pretty sad, that you can't use normal presets and just load them from lua code.
(It's probaly do able, but I have no Idea how)
I'm either dumb or blind, I don't know what you want me to tell with that.
I was talking about, that it's sad, that you can't load the presets from /settings/presets/bloom/ and just load them in.
I'm still curtious why it's so extremly bright, but when I select them over the Menu , with Color Values, it's not.
Sorry, you need to Log In to post a reply to this thread.