Jump to content

Lunarovich

Members
  • Posts

    166
  • Joined

  • Last visited

Everything posted by Lunarovich

  1. Hello, I've just put on the github a LE based extremelly lightweight 2d drawing library draft for easy mini 2d game creation and a bit more complex UI creation Here is a blog post that explains the motivation and a link to my github. Just put those 2 files (including LED folder) in your Scripts folder and lauch the game to see what you can do with a library
  2. Let's admit it, LE context drawing functions are essentially OK, but are very basic and very low-level. I wish something like LED library API would make a part of the official LE API one day. Until then, here is LED: a lightweight (~350 lines of code) LUA 2d drawing library draft. It gives you out of the box entities - Text, Panel, Image and Animation - enriched with useful functions like SetPosition, SetScale, SetColor, Release and similar. In order to use it grab Main.lua (for the example) and LED/LED.lua (for the lib itself) files from my github. P.S. Library is in its early state of development, so bugs are possible (even trivial ones ). In the future, I'll add the documentation (for now, use the Main.lua example and read the code - it's not complicated) and more functionality. Do not hesitate to participate in the development if you like the project. EDIT 04.06.15 Added SetPivot() via shaders. EDIT 05.06.15 Added Intersection(). Now you can test for basic rectangle based overlapping.
  3. Hello, when I use Context:DrawRect() with scaled (1, 3) context with a style = 1 (ie. not filled) I get this as a result: On the contrary, when I use style = 0 - ie. filled rectangle, everything seems to be OK:
  4. Maybe now it's the right time to get it if you need it: P.S. How do you do a global variable dump?
  5. Thank you for these excellent answers! I'm wandering, though, why those stay undocumented... Btw, how do you know these things? From Visual Studio auto-complete, trial & error, and similar? P.S. If they are there, why do you say that they are unsupported? Because they might change in the future, might disappear, or similar?
  6. I have two questions regarding terrain: 1) How can I access a terrain made in the editor from Lua script? Secondly, is there any way to create it programmatically / procedurally, ie. via scripting and not in the editor? 2) I see that a terrain is shaded, which is fine. However, I notice that it does not cast shadows, which is very unrealistic. Is there a way to make it cast shadows. Thank you!
  7. Thank you. I had similar issues with point lights. This is probably the last AMD card that I'll ever buy in any near future.
  8. Clamping is more for things like skyboxes and similar. Clamping basically means that a texture will be stretched and not wraped (repeated). It's used to prevent seems... Does have nothing to do, IMO, with lensflare flickering problem. Lensflare should not flicker like crazy. It's either a problem with my graphics card or with LE. Has anyone used lensflare with any success?
  9. Is it normal for the lensflare to flicker like crazy? Also, I've noticed that when I set occlusion culling to false, it does not get displayed at all. How do we use lensflare at all?
  10. I think so. It has to do with the compiler LE is using. Anyway, do yoy (or anyone else) could tell me, how do we create now (in LE 3.5) Visual Studio Project?
  11. How do we setup Visual studio project now? Can we use Code::Blocks in Windows?
  12. Thank you. I find it quite disconcerting, as a matter of fact, that you have to use some long and eventually bug prone and complicated code to be able to read simple input event several times in one frame. (BTW, not a single word in API reference about it). It goes against the intuition and philosophy of LE, which I sum up as a meaningful and up to the point simplicity. I have chosen it exactly in order not to have to do such things.
  13. Thanks for the answer! If the part of the current state of the entity depends on the Script:Start(), that part will never be copied to the new entity, since Script:Start() never gets called and copy does not simply make an exact replica of the instance. Agree. However, that happens only in the next application tick. In the current application tick - the one that we copy the entity in -, the script is attached and available (it is not nil). What I find misleading is the fact that a copied entity gets the script without a normal flow of script execution. As a sidenote, there are some other script quirks, at least IMO. For example, one cannot call multiple times Window:MouseHit() inside the same Script:Update() function invocation and expect to get the same results. The first time, call to WIndow:MouseHit() gives a reliable value. Every subsequent time it gives nil, so you cannot make two susequent tests with Window:MouseHit(). Instead, you have to register a value in the variable.
  14. I've run into a situation which seems to be counterintuitive. When I run the following code local entity = self.entity:Copy() end try to access entity's properties that get set in Script:Start() directly afterwards and via entity.script.prop, they are all nil, that is, they don't exist at all. What is more, Script:Start() does not get called at all, even after the tick/frame in question and before the Script:Update() of the next tick/frame. On the contrary, if I run the same code with a line added local entity = self.entity:Copy() entity.script.Start(entity.script) -- here I call manually Script:Start() of the entity everything works as expected. So, shouldn't this behavior be built into LE? I mean, everyone expects that an initialization script runs on entity creation (instancing / copying).
  15. I'm having an issue when I try to execute local entity = self.entity:Copy() I get an error "Script classname sin not found." The self.entity in question has a script named Sin.lua attached. Any ideas? EDIT After renaming and reattaching the script file, everything seems to work for now... Does it have to do with the fact that I've edited it in the external editor?
  16. Great! Thank you very much. Btw 1, I've hit the strange issue of point light reflection on the static surface. I've run test on two different Windows with AMD: desktop and laptop. Namely, if I do a very large zoom on the cast light - the camera still contains the entire reflection in its view -, it starts to flicker on the desktop: the reflection is displayed every other frame. On the laptop, the cast light disappears completely as if there were no light. Btw 2, wouldn't it be also OK to take account of a camera zoom when calculating the visibility of the shadow, as I've suggested in the first place? EDIT Point light flickers even on lower zoom levels when partially inside the camera view. Turning off the occlusion culling solves the problem. Should the light filcker with the occlusion culling enabled? EDIT The central issue of this thread, ie. shadow culling when camera far away and zooms in, does not happen with point light cast shadows. Is this the inconsistent behavior?
  17. Thanks for the answer. Is there a way to set it with Lua? For the current project, I'm not using C++. Anyway, does this setting has anything to do with the zoom or just makes shadows visible from a longer distance?
  18. Alright, this seems like a pretty important issue to me. As it is desirable and expected, directional light shadows are culled (not showed/displayed) when the camera is far away from the object: it has to be within the range of 30m or so, as I've seen so far, in order that shadows get rendered (at least with default light quality). However, when camera is set far away from the object, but zooms in so that it appears very near to the object, shadows are not rendered either. If you think about it, that is a highly unrealistic behavior: Imagine a camera that simulates binoculars. If we look through our binoculars, we are supposed to see the object as if it was near us. In that case, we would see shadows it casts if it is lit by the sun, no matter how far away our binoculars from the object actually are. However, with current LE settings it seems not possible to set cast shadow rendering distance based on the camera zoom level (I'm not sure if it's possible at all, btw - I've read some past threads and no one seems to give a definitive answer). So, a simple improvment on the shadow culling calculation - which would consist in inclusion of dividing camera distance by its zoom level - would be an easy modifcation and more than welcome. At least, IMO. P.S. I've tried setting light's quality to max. It does not solve the issue.
  19. I've just tried to put camera far away with a high zoom value. There are to problems to the solution: Directional light drop shadows are not rendered if the camera is too far away. Is there a way to tell camera to render shadows even if its very far from objects? Vertical lines are not vertical anymore because of the small perspective deformation, so it creates aliased object edges. How do I set higher AA? Thanks!
  20. Hello! I cannot find the user guide anymore. The old URL leads to the API reference page. Is it a bug or some rewrite of guide / reorganization of the web site? In the meantime, where can I find a copy of user guide? Thanks.
  21. Yeah, I understand. It would be nice though to have drop shadows with ortographic rendering. In that way we could mimic in 3D good old isometric RPG-s (Fallout, Arcanum, etc). Those had art made in 3D model editors and code done in 2D engines. I gave an ortographic camera (30, 30, 0) rotation and a FOV clamped to 0.5 - 7.5. Than I've implemented some camera controls - global horizontal xz plane movement and modifyable FOV to mimic zoom - to replicate Fallout 1 camera. It's a real bliss Missing those shadows though...
  22. OK. Thanx. Got it and got it working A side question: does the orthographic camera render drop shadows? Added point lights with shadows in the FOV of camera but nothing seems to happen...
  23. When I try to change a camera mode to Camera.Ortographic, I get a "error in function 'SetProjectionMode'.; argument #2 is 'nil'; 'number' expected." function Script:UpdateWorld() if (window:KeyHit(Key.Space)) then if (self.entity:GetProjectionMode()==Camera.Orthographic) then self.entity:SetProjectionMode(Camera.Perspective) self.entity:SetZoom(1) else self.entity:SetProjectionMode(Camera.Ortographic) self.entity:SetZoom(1) end end end
×
×
  • Create New...