-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing Textures Fix #3823
Missing Textures Fix #3823
Conversation
Thanks for looking into this, @lasalvavida. Update CHANGES.md. Also add a unit test if a reasonable one can be written for this. @bagnell please review and merge when you are available. |
@lasalvavida Are you seeing any test failures? |
@bagnell, yes I am. Since the TextureAtlas doesn't rely on a shader + draw command anymore some of the color tests are failing and initial size is only respected when it is greater than the first image added with border, so some of those hard-coded size tests are failing. I'll update the tests. Edit: The color test failures were caused by an issue in chrome where the texture wasn't respecting the first |
@bagnell Whenever you get a chance, this is ready for a look |
@lasalvavida can you merge in master and fix the conflicts (it's probably just changes.md) @bagnell it would be nice to get this into the next release. Can you take a quick look when it's ready? |
Merged changes.md |
I still see 19 test failures in Chrome 50 that don't occur in master. |
@bagnell, test failures should be fixed, and #3730 should no longer be present in @TomPed's example code |
The first screenshot is from this CZML example which also seems to behave correctly. |
gl.texImage2D(textureTarget, 0, internalFormat, width, height, 0, pixelFormat, pixelDatatype, null); | ||
gl.framebufferTexture2D(framebufferTarget, gl.COLOR_ATTACHMENT0, textureTarget, texture, 0); | ||
|
||
if(pixelFormat === gl.RGBA) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change this up a bit so that we attach to a framebuffer and clear only for RGBA
textures?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this only happen for RGBA
textures? What about RGB
textures? I doubt we would have the problem with any of the depth formats since they are only used as render targets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create a standalone example and submit a Chrome bug then add a link in the comment?
@lasalvavida This looks good. Resolve the conflict with master and I'll merge this. |
@bagnell Updated |
This is a fix for #3730, though technically it is also a fix for #2997. It seems like #3730 was actually caused by #3011 breaking the resizing behavior of the
TextureAtlas
.I included the contents of the
TextureAtlas
in the top left corner of the screenshots here to illustrate the failures.The symptom of #2997 was the first letter disappearing.
The cause of this issue was actually the creation of the initial texture in the constructor. The font-size in the reported issue is important to note, because if the image being added was larger than the initial texture, it was re-generated and everything was fine.
#3011 fixed this, but caused issues when textures needed to be resized.
The resize failure can be seen below.
Before resize:
After resize:
I suspect the underlying cause is something to do with the state when the constructor is called. This can be resolved by creating the initial texture when the first image is added.
Here are the examples shown with the fix applied: