Merge branch 'main' into release-0.28
This commit is contained in:
commit
df505355b8
@ -34,4 +34,24 @@ gfx.posteffect.is_active(slot: int) --> bool
|
||||
|
||||
-- Sets parameters values ('param' directives)
|
||||
gfx.posteffect.set_params(params: table)
|
||||
|
||||
-- Sets values to an array
|
||||
gfx.posteffect.set_array(
|
||||
-- effect slot index
|
||||
slot: int,
|
||||
-- parameter (array) name
|
||||
name: str
|
||||
-- data string (use Bytearray_as_string function)
|
||||
data: str
|
||||
)
|
||||
|
||||
-- Example of filling an array `#param vec3 u_arrayName[64]`:
|
||||
local buffer = Bytearray(0)
|
||||
for i = 0, 63 do
|
||||
local x = math.random() * 2.0 - 1.0
|
||||
local y = math.random() * 2.0 - 1.0
|
||||
local z = math.random() * 2.0 - 1.0
|
||||
Bytearray.append(buffer, byteutil.pack("fff", x, y, z))
|
||||
end
|
||||
gfx.posteffects.set_array(slot, "u_arrayName", Bytearray_as_string(buffer))
|
||||
```
|
||||
|
||||
@ -34,4 +34,24 @@ gfx.posteffect.is_active(slot: int) --> bool
|
||||
|
||||
-- Устанавливает значения параметров (директивы 'param')
|
||||
gfx.posteffect.set_params(params: table)
|
||||
|
||||
-- Устанавливает значения в массив
|
||||
gfx.posteffect.set_array(
|
||||
-- индекс слота эффектов
|
||||
slot: int,
|
||||
-- имя параметра (массива)
|
||||
name: str
|
||||
-- строка данных (используйте функцию Bytearray_as_string)
|
||||
data: str
|
||||
)
|
||||
|
||||
-- Пример заполнения массива `#param vec3 u_имяМассива[64]`:
|
||||
local buffer = Bytearray(0)
|
||||
for i = 0, 63 do
|
||||
local x = math.random() * 2.0 - 1.0
|
||||
local y = math.random() * 2.0 - 1.0
|
||||
local z = math.random() * 2.0 - 1.0
|
||||
Bytearray.append(buffer, byteutil.pack("fff", x, y, z))
|
||||
end
|
||||
gfx.posteffects.set_array(slot, "u_имяМассива", Bytearray_as_string(buffer))
|
||||
```
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user