0
\$\begingroup\$

I'm looking at using the 'savetopng' method of the texture2D class to draw out custom textures. My problem is that my viewport is quite small (the application runs in a window) and the textures will often times run off the screen up to the maximum texture size of 2048px. If I know the texture size ahead of time am I able to instead create an array larger than the visible screen area. Or will the fact that the pixels are outside the viewport mean that they are not being rendered and as a result won't have the correct values?

\$\endgroup\$
2
\$\begingroup\$

The easier is to test it... :)

but yes... you can...

the texture maximum size is 2048x2048 or 4096x4096 depends on the profile,

you can use a array in CPU memory to fill it,

 Color[] colors = new Color[2048x2048] 
 Texture.SetData(colors); 

and save to png method is no related to viewport.

\$\endgroup\$
0
\$\begingroup\$

The savetopng method copies the texture from the graphics card into a specified file in png format. The view port has nothing to do with it. The textures may be smaller or larger than the actual window. So the answer is yes.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.