Giter Club home page Giter Club logo

Comments (11)

EnlightenedOne avatar EnlightenedOne commented on July 18, 2024

I manually verified the initial texture coordinates are valid below, the texture is clearly drawn correctly for all intensive purposes. See the verifying code below:

int hSegments2 = floorf((hillKeyPoints[1].x-hillKeyPoints[0].x)/(kHillSegmentWidth * CC_CONTENT_SCALE_FACTOR()));
float dx2 = (hillKeyPoints[1].x - hillKeyPoints[0].x) / hSegments2;

hillTexCoords[0] = (ccVertex2F){hillKeyPoints[0].x/(float)textureSize, 0};
hillTexCoords[1] = (ccVertex2F){(hillKeyPoints[0].x + dx2)/(float)textureSize, 0};

hillTexCoords[2] = (ccVertex2F){hillKeyPoints[0].x/(float)textureSize, 1};
hillTexCoords[3] = (ccVertex2F){(hillKeyPoints[0].x + dx2)/(float)textureSize, 1};

Drawing artifiact checks:
*The texture must be fine because it is repeated over the surface.
*The texture positions must be fine or there would be invalid drawing artifiact.
*The coordinates are fine as I just verified.
*The glColor value ensures the initial value is valid.
*The drawing process might have issues...
*The shader might be buggy...

This is what my drawing process looks like:
glBindTexture(GL_TEXTURE_2D, _stripes.texture.name);

glDisableClientState(GL_COLOR_ARRAY);

glColor4f(1, 1, 1, 1);

//Disable all alpha ops that might be induced by anything.
//glBlendFunc(GL_ONE, GL_ZERO);

glVertexPointer(2, GL_FLOAT, 0, hillVerticies]);
glTexCoordPointer(2, GL_FLOAT, 0, hillTexCoords]);

glDrawArrays(GL_TRIANGLE_STRIP, 0, (GLsizei)nHillVertices]);

glEnableClientState(GL_COLOR_ARRAY);

To help you see the issue I have uploaded a photo of it with an empty background and one with a sky.
Photobucket

from tiny-wings.

EnlightenedOne avatar EnlightenedOne commented on July 18, 2024

If you remove the line "glDisableClientState(GL_COLOR_ARRAY);" in the draw method you can clearly see the area firing off the error, where is the shader being used to draw this? Can anyone see why there is color data bleeding through to the final image?

from tiny-wings.

haqu avatar haqu commented on July 18, 2024

I don't see this issue, but I looked through the code and found one unbalanced glDisableClientState(GL_COLOR_ARRAY); in renderTopBorder. Try adding glEnableClientState(GL_COLOR_ARRAY); to the end of method.

from tiny-wings.

EnlightenedOne avatar EnlightenedOne commented on July 18, 2024

I am using iPhone 5.1 emulator with the iOS 6 SDK and a deployment target of 5.1. Balancing the client states did not help, if I remove the renderHighlight method the issue goes. I modified the code for GLES 2.0 and I still have the issue. One simple solution I wish I had thought of sooner was just to make the render texture have no alpha channel "kCCTexture2DPixelFormat_RGB565" does the trick and doesn't stop you drawing alpha blended colours into the texture over a base colour.

from tiny-wings.

haqu avatar haqu commented on July 18, 2024

Changing render texture pixel format breaks renderHighlight step, as you can see on comparison screenshot:

pixel format comparison

from tiny-wings.

EnlightenedOne avatar EnlightenedOne commented on July 18, 2024

While I can confirm you are 100% correct in GLES 1.0 in GLES 2.0 with the use of Cocos2D's inbuilt shaders this is simply not the case even with the backbuffer using kEAGLColorFormatRGB565 and the texture using kCCTexture2DPixelFormat_RGB565 the shaders still draw the result of the alpha blend operation onto the surface and there is no alpha penalty when using the final texture. The bug in this issue applies accross both versions but not if you disable alpha on the final texture in 2.0! :)

I ported the terrain code to a larger project with GLES 2.0 in it, I am more than happy to share the code surrounding producing the terrain in Cocos 2.0 but I have realised verifying this issue that my rendered texture no longer repeats smoothly. When I have this fixed I will provide the altered source required to port to 2.0. I am suffering a problem drawing the info stats at the same time as using this rendered texture so I was hoping to share the code when I had that solved. The only major kink I had to alter significantly to make things work in 2.0 was the renderBorder being drawn incorrectly.

from tiny-wings.

haqu avatar haqu commented on July 18, 2024

Interesting. I hope someone working with iOS 6 will confirm this issue and maybe propose the solution.

from tiny-wings.

ZuzooVn avatar ZuzooVn commented on July 18, 2024

Is there any update there?

from tiny-wings.

haqu avatar haqu commented on July 18, 2024

check out the latest update.

from tiny-wings.

ZuzooVn avatar ZuzooVn commented on July 18, 2024

Do you have any plan to update more feature for this game?

from tiny-wings.

haqu avatar haqu commented on July 18, 2024

not at this time

from tiny-wings.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.