Do you know if this happened in 3.16 or prior? I have a game where the entire scene is generated on the fly preemptively but my math is always based upon the current screen coordinates +/- 1/2 the screen width. I always end up with an int that isn’t really big.
Are you using ParallaxNode by chance?
Are you using any convertToNodeSpace or convertToWorldSpace calls?
I only noticed the issue in 3.17 not prior. Nope not using any of the api mentioned above. I believe issue is as @cc_x mentioned above that I am having precision issue that’s corrupting the triangles as X gets big.
Trying to figure out how to generate the triangles with small X coords. Maybe just simple as subtracting X with an offset to keep it small. On vacation right now so now way to test it.
It was 4 years ago code is lost, but basic idea is simple.
Your level has objects and they have some coordinates, your scene scrolls from right to left, but objects coordinates are still high by X, so you need to convert their coordinates using convertToWorldSpace and then convertToNodeSpace, and Node will be your screen and what from right side but not far than 2 x width.
Just main idea is that anything that drawn should have coordinates less than 10000px.
This can be also shader precision, if you using some.
But you need to create any drawable object in coordinates not large than 10000 pixels by XY axis, better even less.
We are noticing the corruption starts when X is around ~1000. GLProgram::SHADER_NAME_POSITION_TEXTURE is the shader being used. Maybe the issue is with the shader?
If its a issue with precision then you would like to have a coordinate system to display objects in world coordinate system. You should try with convertToWorldSpace() and position them in accordance with world space.
It didn’t worked for you because you are trying to convert child coordinate(position in this case) to parent coordinate space while child is already in parent coordinate space(when i say child->setPosition(Vec2(100,1000)) i am saying put this child in parent space at point(100, 1000)).
Try doing terrainObject->getParent()->getParent()->convertToNodeSpace(Vec2(100, 1000)) and you should see the difference(now casting to grand parent Space). Hope this clears your doubt.
@Lazy_Gamer I very much apologize! I meant convertToWorldSpace not working for me. It seem calling convertToWorldSpace doesn’t do anything. It returns the same input value. Maybe I might be using it wrong.
For example
auto p0 = getParent()->convertToWorldSpace(Vec2(100, 1000));
p0 end up being Vec2(100, 1000)
I will try out below in the morning and get back terrainObject->getParent()->getParent()->convertToNodeSpace(Vec2(100, 1000))