Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

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

33 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

  • 774 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

  • 842 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

  • 117 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

  • 117 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

  • 117 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

  • 774 posts
  • Corona SDK

Looks great!



[TOPIC: post.html]
#33

basiliogerman

[GLOBAL: userInfoPane.html]
basiliogerman
  • Contributor

  • 117 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

  • 774 posts
  • Corona SDK

Great!  Shoots us a link when it gets approval.




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