Jump to content

Can I set area to limit drawing area?


GBear
 Share

Recommended Posts

hi..

 

I set Grayfilter to draw gray screen into container of top;

 

it looks good. but it gave me frame drop..

 

so I checked and finded  size of container is 7168x7168.

 

but I hope to draw screen area like 1280*720 or 1920*1080

 

is there idea?

 

 

 

 

Link to comment
Share on other sites

Ok, suppose you have a sceneContainer with size 7168x7168 and some position. Lets create outerContainer:

outerContainer.addChild(sceneContainer);outerContainer.filters = [new GrayScaleFilter()]; //whatever, i dont remember the class nameouterContainer.filterArea = new Rectangle(0, 0, renderer.width, renderer.height);renderer.render(outerContainer);

Dont forget that you have to re-create that Rectangle on every resize.

 

Also, I suggest you to crop objects that arent seen in viewport (make obj.renderable=false for them) every frame.

Link to comment
Share on other sites

oh.. 
really thx a lot...

 

filterArea is good  and  frame is up when i set it.

 

but I got other problem

 

i set filterArea with Rectange(640, 720) (default 1280, 720)

 

I hoped right side will be drawn original screen

but there is drawn white screen

this image is right is white. 

post-10357-0-36301400-1451479457.png

 

thx..

Link to comment
Share on other sites

i see ..

Copy grayscale filter and modify its shader that way it wont edit the colors or right part. filterArea must be 1280,720. I can help you with that 

this means I have to modify GrayFilter to draw  right part that color is normal?

 

like filterArea = 1280, 720
      filters = [modified GrayFilter]

is it right?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...