3dreamengine / 3DreamEngine

3DreamEngine is an *awesome* 3d engine for LÖVE.
MIT License
393 stars 17 forks source link

example mat file: description error #17

Closed thisnickwasfree closed 4 years ago

thisnickwasfree commented 4 years ago
    color = {1.0, 1.0, 1.0, 1.0},  -- color
    emission = {1.0, 1.0, 1.0,     -- emission color, or the multiplier if a texture is present

Is this a mistype? color = {1.0, 1.0, 1.0, 1.0}, -- color emission = {1.0, 1.0, 1.0}, -- emission color, or the multiplier if a texture is present

BTW, does .3de (or .mat now) work correctly in new version of 3dreamengine? After «too many fixes»? Old version worked fine (still have wind-shaded objects in old-demo working), but now there is the error:

Error: 3DreamEngine/render.lua:233: bad argument #2 to 'send' (table expected, got number) stack traceback:

    [C]: in function 'send'
    3DreamEngine/render.lua:233: in function 'render'
    3DreamEngine/render.lua:468: in function 'renderFull'
    3DreamEngine/render.lua:691: in function 'present'
    main.lua:345: in function 'draw'
    [string "boot.lua"]:618: in function <[string "boot.lua"]:594>
    [C]: in function 'xpcall'

Could you check this and post an example of 100% correct .3de file with names and paths to resources?

Luke100000 commented 4 years ago

Thanks that is a typo. Emission now is an array with length 3, based on the error I assume emission is a number at some point. I renamed 3de to mat because you no longer use the material name as a key, but as a (optional, see material library) var "name". Mat files still uses the same format as the engine at runtime and should work fine.

thisnickwasfree commented 4 years ago

I assume emission is a number at some point.

And the point is: m.emission = love.math.noise(love.timer.getTime() 2.0 + o.torch_id) 1.0 + 1.0

I guess the correct variant should look like this: local _value = love.math.noise(love.timer.getTime() 2.0 + o.torch_id) 1.0 + 1.0 m.emission = {_value, _value, _value}

In other words, you've changed syntax, but not the tutorial.