Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Corona Shader Playground from your web browser!
Started by walter Apr 14 2015 12:13 PM

3 replies to this topic
shader webgl
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

You can play/experiment with Corona custom (fragment) shaders from a webgl-enabled browser. This includes being able to write your own shader code and live previewing them, among other things:

 

https://shader.coronalabs.com/

 

To share the shader code, click "Generate share link"

 

Since Lua means "moon" in Portuguese, here's one of a rotating moon:

 

https://shader.coronalabs.com/#shaders/moon.frag&textures/512/moon-diffuse.jpg&%5B0.005,0.01,-0.3,1.5%5D

 

 



[TOPIC: post.html]
#2

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 846 posts
  • Corona SDK

Ah, cool.  :)

 

How far is the compiler from what would show up in an HTML5 build?

 

I'll test my fragment-only shaders when I get the chance.



[TOPIC: post.html]
#3

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 846 posts
  • Corona SDK

Argh, looks like more of mine depend on vertex shaders than I thought.  :P (Also, I have some "outline" ones that are rather pointless with opaque textures.)

 

That said, all the fragment-only ones seem to work well:

 

Circle (basic) (This is meant to be put on a circle display object; it doesn't bother to discard outside pixels.)
Simplex2 (basic) (Basically the same one from the other thread / Code Exchange; noise adapted from Ashima Arts)
Sphere (basic) (The circle one, but discarding)
Sphere (fractional Brownian motion) (Everything from here on is adapted from Ashima Arts and / or Stefan Gustavson)
 
A lot of the noise samples aren't time-dependent, but have time-updated parameters in the associated demos (and look pretty cool).
 
N.B. If you fiddle with the CoronaVertexUserData parameters in certain effects, a few will interpolate REALLY weirdly since they consist two [0, 1]-range numbers encoded together (fun with cramming into four values!).  :D


[TOPIC: post.html]
#4

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

Really cool!




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: shader, webgl