Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Dynamic lighting camera system
Started by basiliogerman Oct 02 2019 09:50 PM

39 replies to this topic
[TOPIC CONTROLS]
Page 2 of 2 1 2
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

sporkfin

[GLOBAL: userInfoPane.html]
sporkfin
  • Contributor

  • 825 posts
  • Corona SDK

Hey, what are you using as a level editor?


  • basiliogerman likes this

[TOPIC: post.html]
#27

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 848 posts
  • Corona SDK

Great work.

 

What approach did you settle on for watching and propagating state changes?

 

I've been pondering some kind of function, maybe a clone() method for non-group display objects, that would make a new object with all its current Corona-side state replicated. The use cases I had in mind were motion-blur images, mirrors and other reflections, maybe shadows. Of course one can make multiple objects at creation time, but taking an existing object and incorporating it into an effect on demand is another matter. I think I know some of what needs changing in the source but it would touch a lot of objects, so haven't been brave enough to attempt it yet.  :)

 

Vlad mentioned a while ago, on Slack I believe, that uniforms are pretty much set at this point, so should be fine to use.


  • basiliogerman likes this

[TOPIC: post.html]
#28

basiliogerman

[GLOBAL: userInfoPane.html]
basiliogerman
  • Contributor

  • 120 posts
  • Corona SDK

@sporkfin, Sure! I developed the editor myself! The project started out years ago and was used for other games, but i decided to polish it until it was more comfortable to work with. Made with Corona too!

 

@StarCrunch for transforms, some sort of monitoring: intercept x, y, etc. property changes on a new metatable, update the clone object values, and then pass it to the default metatable, effectively updating itself and its clone part. For physics bodies, the only way was to add them to the camera for manual update in an enterFrame, as the physics engine skips the metatable completely. 

 

This can also be done with functions, so you can intercept insert and removeSelf for example, and return a new insert/removeSelf function that inside calls the default one, like extending the default function implementation with some sort of function inheritance. This can be done without metatables even (Just saving a reference to default insert, and replace .insert) then use the inserted object's .path property to recreate a new untextured object, for example. Just try it and see what happens! Git is your friend hehe.

 

Regarding the uniforms, that's awesome! 



[TOPIC: post.html]
#29

basiliogerman

[GLOBAL: userInfoPane.html]
basiliogerman
  • Contributor

  • 120 posts
  • Corona SDK

New progress, and some cool features!

 

Fixed the iOS crash problem faster than anticipated!

 

Optimized light drawing, added light culling, which greatly improves performance on heavy levels, next improvement to try is some sort of pooling, but will leave it as it is as performance is good, still have to test on low end devices.

 

Was getting an error 256 trying to build for android but fixed it today as well. All i had to do was remove the corona and corona simulator directories in the ~/Library/ folder. So next week there will be android testing.

 

Since touch listener objects now have a forwarder object, this object can be manipulated directly, for example to create a bigger touch area than the object itself, without resorting to bigger alpha or tricks:

 

Attached File  Screen Shot 2019-10-26 at 1.45.47 AM.jpg   86.04KB   0 downloads

 

The alpha circle area is the touch area, debug is set to true, so we can view it. This effectively forwards all events from the larger circle to the smaller one. This is all i had to do achieve the above result (touch related result):

playerMarble:addEventListener("touch", touchMarble)
display.newCircle(playerMarble.touchArea, 0, 0, MARBLE_TOUCH_RADIUS)

Where playerMarble is the smaller circle, the .touchArea group is added automatically after adding the event listener, by the light engine.



[TOPIC: post.html]
#30

gamebit.labs

[GLOBAL: userInfoPane.html]
gamebit.labs
  • Contributor

  • 224 posts
  • Corona SDK

Wow!



[TOPIC: post.html]
#31

basiliogerman

[GLOBAL: userInfoPane.html]
basiliogerman
  • Contributor

  • 120 posts
  • Corona SDK

Tiny update, i've been busy with other stuff, but decided to do a small update to the plugin. Added more error handling and testing to make sure nothing breaks, and something extra that can be done with the plugin:

 

Split screen capability

 

Right now framerate is divided between cameras which means that in the video each camera gets 30 frames per second. This is by design as Corona only lets me get so far while trading performance for some features. uncapped/higher FPS possible in the future? As a note, camera canvases can have any shape:

 

Diagonal split screen

 

More Android testing needs to be done in regards to texture handling.


  • StarCrunch, sporkfin and pixec like this

[TOPIC: post.html]
#32

sporkfin

[GLOBAL: userInfoPane.html]
sporkfin
  • Contributor

  • 825 posts
  • Corona SDK

Looks great!



[TOPIC: post.html]
#33

basiliogerman

[GLOBAL: userInfoPane.html]
basiliogerman
  • Contributor

  • 120 posts
  • Corona SDK

Hi guys, long time no see. Happy new year and all that. Got distracted with real life for a bit of time, but it is now time for the newest update: The plugin has been submitted to the marketplace. There are still things to iron out, but if i don't release it now i never will!



[TOPIC: post.html]
#34

sporkfin

[GLOBAL: userInfoPane.html]
sporkfin
  • Contributor

  • 825 posts
  • Corona SDK

Great!  Shoots us a link when it gets approval.



[TOPIC: post.html]
#35

basiliogerman

[GLOBAL: userInfoPane.html]
basiliogerman
  • Contributor

  • 120 posts
  • Corona SDK

Hi everyone, it has been a while. I already had everything up and running to distribute this as a plugin a while ago, but i've changed my mind. I will be releasing this as open source, but i only need one piece of advice, what license should i use? I want to keep it simple, so my guess is to use the MIT license. Anything else i might be missing?


  • StarCrunch likes this

[TOPIC: post.html]
#36

sporkfin

[GLOBAL: userInfoPane.html]
sporkfin
  • Contributor

  • 825 posts
  • Corona SDK

Yeah, that's what I would use.

 

Thanks!  That is very generous of you to share.  Did you finish your project?



[TOPIC: post.html]
#37

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Corona Geek

  • 1,271 posts
  • Corona SDK

MIT is the safest for you, as it frees you from all responsibilities, and it is one of the most common software licenses so potential users will likely know what it is they are agreeing to without having to read the license and understand some weird legalese.

What made you decide to change to open source?



[TOPIC: post.html]
#38

basiliogerman

[GLOBAL: userInfoPane.html]
basiliogerman
  • Contributor

  • 120 posts
  • Corona SDK

@sporkfin The level editor and the game, not yet. I had to pause them to focus on other stuff. These i work on my "free time" even though its more of a "now and then" thing.

 

@XeduR This way i can sort of add features based on what you guys need, and you can also see how it works under the hood. I also want to share some other libraries and ways of organizing projects so i'll be sharing that too, soon. 

 

As to what made me change my mind, well... i've been sitting on this project for a while now, you might as well start using it even if i'm not. Make it for all of us and not just me  :D will add the MIT license and release the repo links tomorrow 



[TOPIC: post.html]
#39

basiliogerman

[GLOBAL: userInfoPane.html]
basiliogerman
  • Contributor

  • 120 posts
  • Corona SDK

Alright, here are the links, which should be pretty self-explanatory

 

https://github.com/Zetosoft/dynacam-demo

https://github.com/Zetosoft/dynacam

 

Please note that this structure uses my way of using dependencies with a command line tool, which was not intended for LUA or Corona in any way. The project also showcases my other library

 

https://github.com/cetobasilius/index

 

Which is like a require shortener, useful for tons of dependencies on a single folder and cross library referencing, using pure LUA, i'm sure it will come in handy.

 

Please read the instructions carefully, if anything comes up i'll be around, send me a message or post here? Anyway, test it out and tell me what you think of it. Enjoy, and happy coding!  :)

 

I'm using Corona Version 2019.3542 (2019.10.24) so it must work with that and up


  • StarCrunch, sporkfin and w967 like this

[TOPIC: post.html]
#40

sporkfin

[GLOBAL: userInfoPane.html]
sporkfin
  • Contributor

  • 825 posts
  • Corona SDK

Wow, I feel like I just found the buried treasure!  Thanks for sharing, like I said before, that is quite generous!


  • basiliogerman likes this


[topic_controls]
Page 2 of 2 1 2
 
[/topic_controls]