Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Need help with my custom shader
Started by element_skate Oct 27 2016 09:41 AM

3 replies to this topic
shader help corona custom shaders newbie question portal teleport
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

element_skate

[GLOBAL: userInfoPane.html]
element_skate
  • Enthusiast

  • 36 posts
  • Corona SDK

Hi guys,

 

This is my second post here regarding the custom shaders in Corona.

 

I played a bit with different shaders from Shadertoy and mixed several of them to create a portal effect, although it's not fully complete.

Here is the link for the Corona Shader Playground: https://goo.gl/Uxn7VQ

 

Basically, what I want to achieve here is to make the black rotating part white instead. I tried playing with the code but couldn't do it. :(

 

If anyone has any knowledge on how to achieve this I'd be really grateful.

 

Thank you all and have a nice day!



[TOPIC: post.html]
#2

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 846 posts
  • Corona SDK

Hi.

 

It seems okay with these two lines at the end:

    P_COLOR float c = step(f, .05); // some arbitrary threshold
    return CoronaColorScale(vec4(max((f*horColour), vec3(c)) , 1.0));

although the inner circle is sensitive to that threshold's value.



[TOPIC: post.html]
#3

element_skate

[GLOBAL: userInfoPane.html]
element_skate
  • Enthusiast

  • 36 posts
  • Corona SDK

Hi.

 

It seems okay with these two lines at the end:

    P_COLOR float c = step(f, .05); // some arbitrary threshold
    return CoronaColorScale(vec4(max((f*horColour), vec3(c)) , 1.0));

although the inner circle is sensitive to that threshold's value.

 

Hi StarCrunch,

 

Thank you for your help and for your fast answer! I will play a bit more with this shader and if something good comes out of it I'll definitely share it :)



[TOPIC: post.html]
#4

rakoonic

[GLOBAL: userInfoPane.html]
rakoonic
  • Contributor

  • 113 posts
  • Corona SDK

Randomly stumbled across this thread. My suggestion would be this:

   return CoronaColorScale(vec4((1.-f*horColour) , 1.0));

and then fix the colours in the //get the colour bit.




[topic_controls]
[/topic_controls]