Note that there are some explanatory texts on larger screens.

plurals
  1. USm.umar
    primarykey
    data
    text
    plurals
    1. COI'm a bit confused, so you are saying that the alpha mask does not have to be a CCRenderTexture? If its not then how will I compare the alpha values in the other fragment shader for masking? If it is a CCRenderTexture then should I generate it using Ray's method i.e. instead of generating random colours, I should generate the white color 1.0,1.0,1.0,1.0?
      singulars
    2. COThank You Pat, you have made my day :) A thing I noticed while implementing your solution, _hillVertices[_nHillVertices].y was returning a value of 0 when I printed the value in the console. So I took pt0.y and pt1.y respectively and divided those values by 512. Now I have a really good fit underneath the path, but sometimes as I move along the path I have noticed the sprite is a bit skewed towards the right. This might have to do with some x values, but anyways thanks again for your help!
      singulars
    3. COThank You, it works beautifully now. But there is still a small problem, the sprite I am using to display under the path has some shapes drawn to display grass and other things, these are all getting squished down because I am binding a 512x512 (1024x768) sprite in my draw. Is there some way to rectify this problem? This is why I was trying to use the masking technique, I faced this problem too when I used Ray's code in OpenGL 1.1, i.e. the sprite gets squished. It works fine if I have a plain sprite with a solid color though :)
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload