Up-scaling (scaleX, scaleY do nothing)

Software: Away3D 4.x

Suese, Newbie
Posted: 13 January 2013 10:58 AM   Total Posts: 6

Away 4.x question.

To speed up rendering times on my high resolution device - the OUYA- , I need to render the screen at a resolution much lower than 1080p and up-scale the results.

So for clarification I want the back buffer to be only 480x270 but still display full-screen. 

My first instinct was to set scaleX and scaleY on my View3D object.
view.scaleX = 4
view.scaleY = 4

but it seems scaleX and scaleY do not do anything on the View3D object.

Yes,  I understand this will make the display look ‘grainy’ or ‘pixelated’.  Along with the performance upgrade this is a desired effect.

   

bart_the_13th, Newbie
Posted: 13 January 2013 04:32 PM   Total Posts: 14   [ # 1 ]

This may sound dumb but have you set the view.width and view.height?
You might also want to render the view to a bitmap/texture then stretch the texture to fit to fullscreen

I’m not sure about using scaleX and scaleY since there’s also scaleZ

   

Suese, Newbie
Posted: 13 January 2013 05:49 PM   Total Posts: 6   [ # 2 ]

Yes,  I set
view.width = 480
view.height = 270
it appears as a little rectangle in the upper left corner.

Render to texture was my second idea. I can’t find any examples on how to render to a texture. 

A third thing a guy has suggested is to use full screen , but neither the scale mode nor the fullScreenSourceRect effects Stage3Ds

stage.fullScreenSourceRect = new Rectangle(0,0,480,270)
stage.stageDisplayMode = StageDisplayMode.FULL_SCREEN_INTERACTIVE

   

Rayen123, Member
Posted: 08 September 2013 01:27 PM   Total Posts: 70   [ # 3 ]

Hi, do you solved this? Because I have the same problem

   

Jawdy, Newbie
Posted: 19 June 2014 12:00 PM   Total Posts: 3   [ # 4 ]

Reviving and old thread - but I had the *exact* same issue and have overcome it!

TL;DR
You only need to change the Proxy Width/Height, like so:

Stage3DManager.getInstancethis.stage ).getStage3DProxy).width this.stage.fullScreenWidth;
Stage3DManager.getInstancethis.stage ).getStage3DProxy).height this.stage.fullScreenHeight

——-

I battled with this for some time.
First, I tried messing with the View3D values, much like everyone else.
I’ve delved into the RendererBase, and in there, you have TextureRatioX/Y, but (and the clue’s in the name!) this had no effect on render to screen… so obviously works on render to texture.

A little more digging, and I found the “Scissor Rectangle” that’s in Context3D.
I exposed this in the View3D… still no effect.  Even making it smaller seemed to do little/nothing.

A little more reading and there was a post about Starling/Away3D interop, which talked about problems with a shared context, back buffer and view size not being updated.
<light bulb!>

Finally I hit up the Stage3DManager & Proxy classes, which talk about their width/height values changing the Stage3D values for the size to render to.  A quick change and it worked!
OK, so my first thought was “Has this changed the back buffer?”  It shouldn’t, so the View3D should still be what I’ve set the SWF size, right?  Trace out the View3D’s width and height values - still my smaller size!
Woo!

What I’ve used is:

[SWFframeRate="30"width="1280"height="720" )]
public class YourClassName extends Sprite
{
...
<
instantiate some view...>

Stage3DManager.getInstancethis.stage ).getStage3DProxy).width this.stage.fullScreenWidth;
Stage3DManager.getInstancethis.stage ).getStage3DProxy).height this.stage.fullScreenHeight;
   
trace"View Width: " this.view.width ", Height: " this.view.height ); 

And that’s it :-D
Hope it helps!

   

Jawdy, Newbie
Posted: 19 June 2014 01:39 PM   Total Posts: 3   [ # 5 ]

OK, so that made the background colour fill the whole screen… but the view is still locked to the top left corner.

Getting closer, at least!

   

Jawdy, Newbie
Posted: 19 June 2014 02:08 PM   Total Posts: 3   [ # 6 ]

Ah-ha!
I mentioned above that “ScissorRect” didn’t appear to do anything - and why would it?  At the time, the Stage3D dimensions matched the View3D dimensions, so there was nothing the Stage3D instance could do to make the View3D larger via this method.

Now that, with the above code, the Stage3DProxy width & height values have been set to fullScreenWidth/Height, if you do the same on the scissorRect width/height values, it’ll render the view fullscreen and still preserve the View3D’s original dimensions!

view.scissorWidth this.stage.fullScreenWidth;
view.scissorHeight this.stage.fullScreenHeight;
view.stage3DProxy.width this.stage.fullScreenWidth;
view.stage3DProxy.height this.stage.fullScreenHeight

For all I can see, this appears to be working fine for me grin

EDIT:
I just realised that .scissorWidth/Height properties are ones that I added myself.  All they do is:

public function set scissorWidthvalue:Number ):void
{
_scissorRect
.width value;

Change the _scissorRect.width for scissorWidth() and .height for scissorHeight() and you’re good to go!!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X