Highlighted

Use RectangleTexture with setRenderToTexture

New Here ,
Aug 31, 2016

Copy link to clipboard

Copied

Has anyone had any luck with using context3D.setRenderToTexture with an instance of the RectangleTexture that is not a power of two? When I create a RectangleTexture with the dimensions of the screen (in my test environment 1440 x 900) and assign it using context3D.setRenderToTexture nothing is drawn to the texture. This problem does not occur if I use a Texture (power of two).

Steps to Reproduce:

- Create a rectangle texture the dimensions of the screen.

- Set the context to use the texture.

- Use drawTriangles to draw the vertex and index data to the texture.

- Set the context to use the back buffer

- Draw the texture into the back buffer and nothing will appear

This is the shader I am using to draw the render texture into the back buffer:

Vertex:

mov op, va0

mov v0, va1

Fragment:

tex ft0, v0, fs0 <2d, nomip, clamp, linear>

mov oc, ft0

If you create an instance of Texture and follow the above steps correctly the problem goes away.

TOPICS
Air beta

Views

230

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Use RectangleTexture with setRenderToTexture

New Here ,
Aug 31, 2016

Copy link to clipboard

Copied

Has anyone had any luck with using context3D.setRenderToTexture with an instance of the RectangleTexture that is not a power of two? When I create a RectangleTexture with the dimensions of the screen (in my test environment 1440 x 900) and assign it using context3D.setRenderToTexture nothing is drawn to the texture. This problem does not occur if I use a Texture (power of two).

Steps to Reproduce:

- Create a rectangle texture the dimensions of the screen.

- Set the context to use the texture.

- Use drawTriangles to draw the vertex and index data to the texture.

- Set the context to use the back buffer

- Draw the texture into the back buffer and nothing will appear

This is the shader I am using to draw the render texture into the back buffer:

Vertex:

mov op, va0

mov v0, va1

Fragment:

tex ft0, v0, fs0 <2d, nomip, clamp, linear>

mov oc, ft0

If you create an instance of Texture and follow the above steps correctly the problem goes away.

TOPICS
Air beta

Views

231

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 31, 2016 0

Have something to add?

Join the conversation