Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Catlard · Sep 23, 2011 at 03:11 AM · guiguitexturedrawcallsdrawingscreencapture

Using screencapture to reduce expensive draw calls.

I'm creating a game that involves drawing on the screen with the mouse. I'm doing this by storing all the information about where the textures that have been painted onto the screen are located (their x, y, alpha, scale, etc.). Basically, after the array contains information for about 1500 textures (they're paintsplats, meant to simulate chinese calligraphic drawing), it understandably slows the game down a bit. I see TWO potential solutions to this, and I'd like to know if you know of any more, or if this is it:

1) I can limit the number of times the game records the texture positions, hoping to rely on the overlap of textures to still allow for a good-looking drawing.

2) Take a screen capture after a certain part of the drawing is completed, and use that instead of doing all the hundreds of draw calls it represented. Then replace the texture in front of the camera with that screen capture.

If these are the only solutions, which one do you like the best? Why?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by jonas-echterhoff · Sep 23, 2011 at 04:53 AM

3) Use a RenderTexture. Much faster then reading the screen.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Catlard · Sep 23, 2011 at 06:15 AM 0
Share

Thanks, I think this is exactly the solution I'm looking for...I'll have to check it out the next time I'm in the studio, and am using Pro!

I assume that I'll have to put an object to put the rendertexture on right in front of the camera...because it doesn't look like you can use a rendertexture right to the GUI. Non?

avatar image jonas-echterhoff ♦♦ · Sep 23, 2011 at 06:24 AM 0
Share

You should be able to use a RenderTexture in the GUI like any other texture. Check http://unity3d.com/support/documentation/ScriptReference/GUI.DrawTexture.html.

avatar image
1

Answer by roamcel · Sep 23, 2011 at 04:52 AM

I believe that you should consider merging the meshes into one rather than going another way. There's a script in unify wiki that should lead you in the right direction.

http://www.unifycommunity.com/wiki/index.php?title=MeshMerger

I believe you could arrange to actually create a new mesh after as much strokes as you allow UNDO, to keep things fluent.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Catlard · Sep 23, 2011 at 06:16 AM 0
Share

hmmm...thanks for the lead! I checked out the script, but I couldn't get it working, regrettably. I think the rendertexture solution will work, however, considering I have access to Pro. Cheers.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Reduce Draw call for Multiple GUI Textures with same Texture 1 Answer

Is it expensive to use SetPixels() every frame for a second or 2? 1 Answer

Captured Screenshots as Textures (Pseudocode needed!) 0 Answers

HUD with a lot of elements, efficient way? 3 Answers

Toggle GuiTexture 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges