StarCrunch

@vlads Yours is what I'm hoping to get. Probably a dumb question, but that's also the simulator? (Just noting the differences at the top from Matthew's shot.)

What Matthew has matches what I was shown earlier. The vertices in that case come from userdata, whereas the uvs should be in the texture but seem to resolve to 0. (I think.) If the same thing's happening with the other triangles, the vertex information is all 0 too and so we have a zero area triangle.

StarCrunch

[GLOBAL: userInfoPane.html]

StarCrunch

Contributor

787 posts

Corona SDK

05 February 2016 - 03:07 PM

I got around to working on this on Android and was running into the same problems. On investigation, it looks like the shader compiler on Windows was overly lenient about the ordering of certain keywords, namely varying and the precision qualifier. (When it comes to out params, the others are the offenders. Go figure.) With that I have it running on an older tablet.

Could I get another couple tests on OSX, to see if this fixed the issues? I'd be interested in any iOS results, as well. (Same link as before.)

There are now three instances of the mesh showing at once, though the right-hand one should gracefully go transparent when vertex texture fetch is unavailable. This is probably unlikely on desktop, but a decent possibility on mobile.

Each of these three implements a different technique. The newest is a fairly brute force approach, but its vertices are able to go offscreen. The other two use some encodings that depend on coordinates being in the range [0, 1024)... to fix that I either need to write a ton of shaders for the corner cases or perform clipping, which would really complicate the internals. For now I'm just clamping in these cases.

I've added some touch controls to move the vertices around (the blue circles on one of the meshes) as well as the texture coordinates (the red ones, below).

do you get true or false? If false, that will explain the missing parts. (I'm getting mixed results trying to learn which architectures support vertex texture fetch, sometimes blaming the driver as well.)

vlads

[GLOBAL: userInfoPane.html]

vlads

Contributor

610 posts

Corona Staff

01 March 2016 - 12:59 PM

Hey guys! I really appreciated your feedback on TextureResourceCanvas. I have small request - I added several features to it, can you provide your feedback for them? They aren't documented yet, because I'm not sure if they're final. So, give it a try:

1. basically, new feature is anchorX and anchorY properties of TextureResourceCanvas. With them you can change origin of Canvas' viewport / pan

2. width and height for Canvases (only) are now modifiable. It can be used to change size of Canvas' viewport / zoom.

I attached updated Canvas Demo example. I would be very grateful for your feedback.

Then I tried each of the following methods in an attempt to set the mask from the texture. (Besides this, I also tried to create a Mask directly from the canvas file but that blows up as previously indicated StarCrunch.)

redninjacat

[GLOBAL: userInfoPane.html]

redninjacat

Contributor

196 posts

Corona SDK

18 April 2016 - 10:05 AM

@vlads I am trying to dynamically create a mask by using the texture canvas. My sample code as-is does not work as I want. (I want the flashlight effect.) If you comment out "image:setMask( mask2 )" and uncomment "image:setMask( mask )", the flashlight works just like in the original flashlight demo since it using the png. What I want is for the canvas texture to be used ("mask2" or "mask3"). Your prior comment says "But you can set mask to objects using it as a fill without a problem." but I must not be doing that correctly.

redninjacat

[GLOBAL: userInfoPane.html]

redninjacat

Contributor

196 posts

Corona SDK

16 May 2016 - 06:48 AM

Hey Vlads, I just wanted to express my gratitude for these new features! Being able to draw to a texture is incredible! I had been using snapshots to develop a game that uses entirely procedurally generated graphics. I was having performance problems though so I had to implement object caching. Once this new feature came out, I converted my code to use textures and discovered that my objects were created so quickly that I no longer needed object caching! Texture canvases rock!