Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 fotos · Nov 11, 2013 at 02:02 AM · shaderpaintingline drawingbrush

Painting using a brush for iOS

Hello everyone,

I'm trying to make a painting app for iOS but I don't know what is the best approach in implementing a brush. First I started by using a Texture2D and SetPixels, which did what I wanted it to, but the Apply function was making the whole app too slow so I had to change direction. I though of using OpenGL but as I want more complex behavior from just drawing lines, I didn't think that was I viable solution.

Therefore right now I'm trying to make this work by drawing on a mesh. Based on where the user clicks I generate vertices and triangles based on the width I want. This works perfectly for solid lines. However right now I want to add an air brush (similar to Windows Paint, or what they use for graffiti), and something like an oil / waterbrush. Basically all of the above require a triangle on the mesh to be drawn with either color variation or using a texture. I'm pretty sure I should be able to do something like that using shaders and applying the appropriate texture, but I'm not as knowledgeable to figure how to make it work.

Can I get any suggestions on how I can achieve what I'm trying to do, and if this is the right direction or if there is an alternative?

Thanks, Fotos

Comment
Add comment · Show 3
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 BeardOfFury · Nov 12, 2013 at 10:22 PM 0
Share

How did you go checking out Unity Paint?

avatar image fotos · Nov 13, 2013 at 06:13 PM 0
Share

Unity Paint did work out the way I wanted to. $$anonymous$$y initial approach was similar to that though using the Texture2D, but for some reason when I was trying it out it spent too much time in the textures' Apply function. So right now I'm trying to figure out the reason behind that, as the two codes look very similar. Thanks for the solution. I had seen Unity Paint myself before but since it was using Texture23D I didn't try in on the iPad.

avatar image zhangxiaoqiangjoe · Apr 28, 2018 at 05:19 AM 0
Share

Hello, I'm trying to make a painting app for iOS but how to draw a pencil stroke?

1 Reply

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

Answer by BeardOfFury · Nov 11, 2013 at 04:01 AM

You could check out:

Unity Paint

It's a demo made by Aron Granberg a while ago. It has pencil, line, eraser, and brush tools. I'm currently using it as a base for my own painting program. The original scripts are in Javascript but someone in the comments made a C# version.

Comment
Add comment · 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

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

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Brush a texture with another texture 0 Answers

How to force the compilation of a shader in Unity? 5 Answers

How can I display flat image on cube gameObject 0 Answers

[Logic] Paint with soft brush 1 Answer

How would you go about 'painting' images onto terrain 0 Answers


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