Skip to content
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

Extended Filter3d classes fire an error. #23

Open
iY0Yi opened this issue Dec 11, 2013 · 3 comments
Open

Extended Filter3d classes fire an error. #23

iY0Yi opened this issue Dec 11, 2013 · 3 comments

Comments

@iY0Yi
Copy link

iY0Yi commented Dec 11, 2013

Hi,
When I use my extended Filter3d classes(Gamma correction shader),
It fires an error.

"Uncaught TypeError: Cannot read property 'width' of undefined"

It occurs in Context3D.setRenderToTexture().
And the width is Texture.frameBuffer.width.
Here are the classes for reproducing:
GammaCorrectionFilter3D.ts
https://gist.github.com/GoroMatsumoto/9405246100f029966bdd
Filter3DGammaCorrectionTask.ts
https://gist.github.com/GoroMatsumoto/26fee6124e22c2ed4423

this._filter3ds = new Array<away.filters.Filter3DBase>();
this._filter3ds[0] = new away.filters.GammaCorrectionFilter3D(2.2);
this._view.filters3d = this._filter3ds;
@karimbeyrouti
Copy link
Contributor

Hello Goro,

looks like that issue was also caused by the TypeScript 0.9.5 update. This should now be fixed in the Repo ( although the fix in Context3D is a bit of a monkey patch for now ) - it should be working with the latest push.

@iY0Yi
Copy link
Author

iY0Yi commented Dec 12, 2013

Hi,

Thank you this fix too.
But I got a new error.

WebGLFramebuffer.width/height is not available(at least on my environment:OSX, chrome).
So, I modified it like below in Context3D.setRenderToTexture().

var width:number = (<away.display3D.Texture>target).width;
var height:number = (<away.display3D.Texture>target).height;

this._gl.viewport['width'] = width;
this._gl.viewport['height'] = height;

this._gl.viewport(0, 0, width, height);

This doesn't get the error on compiling.
And width and height seems that they contain correct value.

But I get 2 of warning on the fly with black screen.

[.WebGLRenderingContext]PERFORMANCE WARNING: Attribute 0 is disabled. This has signficant performance penalty SimpleTest.html:1
[.WebGLRenderingContext]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering or is not 'texture complete'

Could you test my above classes?
It seems that it's a same issue of TypeScript version...

@iY0Yi
Copy link
Author

iY0Yi commented Dec 14, 2013

I guess that there are same problems on BackGroundRenderer, And real time reflection textures.
I have not tested that classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants