3dreamengine / 3dreamengine Goto Github PK
View Code? Open in Web Editor NEW3DreamEngine is an *awesome* 3d engine for LÖVE.
License: MIT License
3DreamEngine is an *awesome* 3d engine for LÖVE.
License: MIT License
Is it possible to load textures through love-loader?
Well, loading textures through love-loader now works fine.
But I've noticed one strange thing: pkm and png textures, loaded through love-loader look like they have linear filter accepted ,when I use nearest one. And the «traditional» method (png and mtl) works as it should.
I've noticed that in previous version some kind of filtering "not in frustum" triangles has appeared.
It works fine at fov 60 (use it in my project), but a bit worse with fov 90.
In the last version of 3DreamEngine it has become more aggressive: some tiles not drawn at the edges of the screen or right after fast camera rotation even with fov 60.
Unlit back faces of for example foliage.
Does 3dreamengine have a possibility to render smaller frame than love2d project's window has?
It would be nice to create 2d frame with custom width and height (like init.resize function does) at custom coordinates (x and y for left upper corner of the frame).
And yeah, last version had special method for changing camera's fov, but looks like it was removed. That's not a real problem to change this in code, but the method was really useful.
Is it possible to activate dithering (like semi-transparent pixels has) for far objects? To allow their slow, step-by-step appearing at the distance of drawing?
https://ibb.co/PTY4VP3
https://ibb.co/FK1q3R7
The first variant is rather strange: even without blending this border should not be large than a pixel, I think.
Looks like frustum counts wrong (like more agressive) for 3do models: they disappear at the edges of the screen. Same obj models works fine.
https://i.ibb.co/GHmQkXr/2020-10-24-205007-1920x1080-scrot.png
Looks nice, but a bit strange.
Semi-transparent pixels looks strange. Like they have triangle holes.
3DreamEngine does not react on pressing keys (via love2d of course) after pressing Shift and some other keys (usually functional and modificators). Letters and arrows work fine. UP: probably my mistake, I'll check this carefully.
Looks like setDirection somehow ignores mesh:reset (): an object gets right (well, looks like) direction in the beginning, but then continue to rotate, if I use setDirection and reset mesh in a cycle to the same vector.
Used once setDirection works fine.
Some objects (not all) looses correct UV-coordinates, if the texture loaded not through mtl and path, but through mat and link. I so not know why this happens, but the modeller says that the possible reason is that UV coordinates are far from limits of texture's square in theese models. Sorry, not a specialist in this question.
Is there any plans of moving some parts of 3Dreamengine to other threads?
The possibility to send the most heavy parts to another core could improve performance, as I think. But I'm not a specialist in this question, so I want to hear other opinions.
Love2d itself has this possibility, but the question is what can be send to other threads safety.
3Dreamengine is nice atm, but better performance would be good. And one of the main problem, as I see, high CPU usage both 3Dreamengine and other code in love 2d, that can cause low fps if CPU's core they both use loaded close to 100%.
I have only default canera in the scene. All methods like
dream.setFov (45);
dream:setNear (1);
dream:setFar (100);
do not work (nil).
But I can use
dream.cam.fov = 45;
dream.cam.near = 1;
dream.cam.far = 100;
I know the readme mentions possible lighting distortion when dream.deferred_lighting = true
. I'm curious if the white edge atrifacts on my shipping container below are an example of this, or if I need to debug my models further? The artifacts don't appear with normal non-deferred lighting.
The model meshes have small rounded bevels on all edges. If I make the bevel radius larger the artifacts move around a bit, but still appear.
In case it's relevant, the code that sets up dream:
dream.msaa = 16
dream.bloom_enabled = false
dream.secondPass = true
dream.deferred_lighting = true
dream.shadow_factor = 4
dream.shadow_resolution = dream.shadow_resolution*2
dream.shadow_cube_resolution = dream.shadow_cube_resolution*2
dream.shadow_distance = 10
dream.sky_enabled = false
dream.sun = vec3(-0.5,1,0)
dream.sun_color = vec3(2.0, 2.0, 2.0)
dream.sun_ambient = vec3(0.5, 0.5, 0.5)
dream.cam.fov = 45
dream.cam.eye = vec3(0,15,5)
dream.cam.target = vec3(0,0,0)
dream:init()
container = dream:loadObject("shipping-container", {splitMaterials = true})
platform = dream:loadObject("platform", {splitMaterials = true})
--- [snip ui test stuff; mouse/camera math]
function love.draw()
dream:resetLight()
dream:prepare()
dream.cam:reset()
dream.cam.transform = dream:lookAt(dream.cam.eye, dream.cam.target)
dream:draw(container, 0, 1, 0)
dream:draw(platform, 0, -0.5, 0)
dream:present()
ui:draw()
end
Unrelated: This engine is great! Thanks for the effort :-)
Any plans for adding 3d buttons to make clicking on 3d scene objects available?
Error: 3DreamEngine/loader.lua:863: bad argument #11 to 'setVertex' (number expected, got table)
stack traceback:
[string "boot.lua"]:777: in function <[string "boot.lua"]:773>
[C]: in function 'setVertex'
3DreamEngine/loader.lua:863: in function 'createMesh'
3DreamEngine/loader.lua:657: in function 'loadObject'
Adding any texture to a mat file (tex_albedo, tex_normal, etc) solves the problem.
Looks like 3do model can not be a collider: even being loaded with noCleanup = true option it causes the error 'can not create the collider, use noCleanup = true'.
SetDirection function for objects, camera, lights is useful. Vector "up" as second parameter is advisable.
https://ibb.co/vjM6s6w
https://ibb.co/jTP09pD
Look at white artifacts at mobs.
They appear when using mat instead mtl.
Blending mode does not matter.
Link or local file — does not matter too.
Both, png and pkm affecte.
deffered_lighting set to false.
Affected sharp edges and angles, at nearer distance all artifacts disappear.
Error: 3DreamEngine/init.lua:181: Could not open file 3DreamEngine/res/brdfLUT.png. Does not exist.
The file presented, but it`s name is brdfLut.png, not brdfLUT.png.
Is there any way to rotate instance (loaded meshes which are drawn several times) not all together?
Usually it has fps close to previous version, may be a bit higher some times.
But, for example, near some dozens of trees (demo with models uploaded, links at the issue with wind shader) it drops fps to ~30. And the old version has 50 — 60 in the same conditions.
I see the 3DSound section is WIP.
So, here is a feature request.
Could you make a sound pool?
For example, we need to play one sound several times: ten explosions, for example, or footsteps while mob walking.
So, starting new sound, we are checking it's playing status, and if the sound is playing, we create a copy of it;s source and starting to play it. The creation of new copies can be limited: if we are out of limit, we stops first sound in pool, and starts it again from initial position.
Looks like fxaa/msaa doesnt work in last version.
https://ibb.co/YNxdfLg
https://ibb.co/6XrwvRT
If dream.cam.far less than 100 (90, 80) black cut appears at sky dome. This cut can not be cleared from content of previous frames.
dream:resetLight(true) in the scene with sun gives this error:
Error: 3DreamEngine/shaders/base/Phong.lua:151: Shader uniform 'tex_normal' does not exist.
A common error is to define but not use the variable.
stack traceback:
[string "boot.lua"]:777: in function <[string "boot.lua"]:773>
[C]: in function 'send'
3DreamEngine/shaders/base/Phong.lua:151: in function 'perMaterial'
3DreamEngine/render.lua:262: in function 'render'
3DreamEngine/render.lua:527: in function 'renderFull'
3DreamEngine/render.lua:714: in function 'present'
dream:resetLight(false) works. Important moment: I use dream:present(false, false, true).
Wrong direction: it worse now.
100m far, artifacts appear after smooth camera direction (to 90°, for example).
https://ibb.co/VMnD2BK
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:
[string "boot.lua"]:777: in function <[string "boot.lua"]:773>
[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?
Any chances to get fast "in frustum" function to draw only those meshes which in camera's fow?
I can check it in love.draw, but it slows down the scene (25 vs ~115 fps). But! The same mechanism gives 165 Vs 140 fps while watching to the area where no meshes placed.
If I add argument to function c:collide its ignored by function (nil) and please add in collide function triangles check maximum distance for better performance :)
https://github.com/thisnickwasfree/3dreamengine_tests
demo3 and demo4 at the link.
In complete scene everything is much worse.
Look at the corrupted textures at the trees:
https://ibb.co/D4W9jsf][img]https://i.ibb.co/G7pWrBQ/2020-10-24-132235-1920x1080-scrot.png
And in realtime they changes their look several times per second.
dream.sun_shadow = false
dream.sun_shadow = false
But there is a shadow on the screenshot:
This might take a bit but it is good to have here
render enabled in efault render pass
efault
There are some clouds at screenshot, right? They are moving…
But I have these in my scene: dream:setClouds(false)
So, how does enabling/disabling of clouds work
https://ibb.co/0tjhT0L
Looks like there is no function for setting sun vector, and using dream.sun = vec3(x, y, z) does not allow to change the moving direction of sun. And the same thing for moon can be useful too. And an interface for adding additional moons and other orbital satellites.
It would be nice to get option for rendering colliders for debug.
Is this enough for rainbow creation: dream:setRainbow(strength, size, thickness)?
I can not find rainbow at skydome.
Could you you return old drawParticle system as an alternative method?
It was much simpler and had better functionality in some cases.
And as for the new one…
So, the upgrading of the new system can help too.
An error occurs if converting some models (I've found 2 or 3 per 100):
Error: 3DreamEngine/libs/utils.lua:87: stack overflow
stack traceback:
[string "boot.lua"]:777: in function '__gc'
3DreamEngine/libs/utils.lua:87: in function 'copyPrimitive'
3DreamEngine/libs/utils.lua:91: in function 'copyPrimitive'
3DreamEngine/libs/utils.lua:91: in function 'copyPrimitive'
3DreamEngine/libs/utils.lua:91: in function 'copyPrimitive'
3DreamEngine/libs/utils.lua:91: in function 'copyPrimitive'
3DreamEngine/libs/utils.lua:91: in function 'copyPrimitive'
3DreamEngine/libs/utils.lua:91: in function 'copyPrimitive'
3DreamEngine/libs/utils.lua:91: in function 'copyPrimitive'
...
3DreamEngine/libs/utils.lua:91: in function 'copyPrimitive'
3DreamEngine/3doExport.lua:35: in function 'export3do'
3DreamEngine/loader.lua:323: in function 'loadObject'
classes/Scene.lua:297: in function 'Convert'
states/playingState.lua:19: in function 'Convert'
states/playingState.lua:35: in function 'keypressed'
main.lua:66: in function main.lua:64
[string "boot.lua"]:604: in function <[string "boot.lua"]:594>
[C]: in function 'xpcall'
I've uploaded models.zip here https://github.com/thisnickwasfree/3dreamengine_tests
This file works fine in 3DreamEngine itself, but can not be converted to 3do.
Another interesting thing (not sure yet) obj files which have particle system at *.mat file can not be correctly converted too… Well, still checking.
Another one error occurs if 3do models are presented at save directory:
Error: 3DreamEngine/loader/3do.lua:44: bad argument #2 to 'unpack' (data string too short)
stack traceback:
[string "boot.lua"]:777: in function <[string "boot.lua"]:773>
[C]: in function 'unpack'
3DreamEngine/loader/3do.lua:44: in function <3DreamEngine/loader/3do.lua:30>
3DreamEngine/loader.lua:76: in function 'loadObject'
classes/Scene.lua:297: in function 'Convert'
states/playingState.lua:19: in function 'Convert'
states/playingState.lua:35: in function 'keypressed'
main.lua:66: in function main.lua:64
[string "boot.lua"]:604: in function <[string "boot.lua"]:594>
[C]: in function 'xpcall'
Error: 3DreamEngine/functions.lua:81: attempt to index local 'uv2' (a nil value)
stack traceback:
[string "boot.lua"]:777: in function '__index'
3DreamEngine/functions.lua:81: in function 'calcTangents'
3DreamEngine/loader.lua:370: in function 'createMesh'
3DreamEngine/loader.lua:293: in function 'loadObject'
dream:setDefaultShaderType("Phong") gives this error with some objects.
dream:setDefaultShaderType("PBR") gives this error with some too.
BTW, print ("SHADER:",dream:getDefaultShaderType()) prints nil.
Or false after dream:setDefaultShaderType(false), dream:setDefaultShaderType(Phong), dream:setDefaultShaderType(phong) — I've checked several variants, sending strings and possible vars.
In old version phong shader works fine with this object.
UP: fine while mtl presented, not mat.
UP2: merging of dup-vetexes and re-unwraping fixes the model, so new version of engine is able to load it.
looks like dream:setSunDir(direction) does not affect sun trajectory.
I've used different values with no result.
Is it possible to turn sun's trajectory at 90° somehow? Through setSunDir or some kind of setNorth function?
Hi,
i'm looking into the exemples and some of them seems broken:
In lamborghini example , knight example, lowpolygame example, monkey example, and particle system example all models are rendered black like there wasn't a light.
it is my fault ?
If I turn camera to 90 or 180°, clouds looks normally again.
Level size is about one km2.
Is it possible to use nearest filter for clouds? To make them «more pixelated»?
Any plans for adding etc and dxt compression support (pkm and dds formats)? Original love2d supports them, what about 3dreamengine?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.