Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Applying Shaders to Polygons
Started by tap32 Sep 22 2015 02:16 AM

4 replies to this topic
[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

tap32

[GLOBAL: userInfoPane.html]
tap32
  • Contributor

  • 257 posts
  • Corona SDK

I'm trying to apply a stripe effect to some polygons. The default stripe generator works fine, but the stripes move with the camera, or rather are not fixed to the polygon as it moves across the screen.

 

Applying my own simple shader https://goo.gl/o3atmf or using a bitmap fill comes out as distorted, with the stripes being compressed and wonky.

 

Does anyone know of anyway round this? I basically want to fix the stripes to the polygon's local space rather than the screen coordinates. For bonus points I want adjacent polygons to have their stripes correctly line up!

 

 



[TOPIC: post.html]
#2

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 848 posts
  • Corona SDK

Are these made by display.newPolygon(), or display.newRect() / display.newImageRect() followed by changing the path corners?



[TOPIC: post.html]
#3

tap32

[GLOBAL: userInfoPane.html]
tap32
  • Contributor

  • 257 posts
  • Corona SDK

They are made by display.newPolygon



[TOPIC: post.html]
#4

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 848 posts
  • Corona SDK

Hmm, weird. Is the bitmap fill a regular image or a frame from an image sheet?



[TOPIC: post.html]
#5

tap32

[GLOBAL: userInfoPane.html]
tap32
  • Contributor

  • 257 posts
  • Corona SDK

Just a regular image 




[topic_controls]
[/topic_controls]