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 Stomper2000 · Mar 28, 2018 at 11:15 PM · directx

Is it possible to draw on a texture lines, shapes and have a transparency mask like DirectX 2d or Open GL 2d does?

Hello, I want to port my drawing engine to Unity. I have a major drawing app on Windows 10 with over half a million users. The drawing engine is written in DirectX 2D with C++. Basically drawing on a texture. I would love to port it to Unity as I am now a Unity master as well! I am trying to decide between Xamarin or Unity as I am only 1 person and I cannot program for each platform. Xamarin does what I need with Open GL but I would rather use Unity if I can.

Is it possible to draw on a texture lines, rectangles, ellipses and have a transparency mask like DirectX 2d or Open GL 2d does?

Thanks

Comment
Add comment · Show 2
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 Bunny83 · Mar 28, 2018 at 11:53 PM 0
Share

The question is a bit vague. What do you mean by transparency mask? By "DirectX 2d" you mean DirectDraw? Open GL always was a 3d framework which of course can be used equally for 2d. Though OpenGL doesn't have any dedicated shape drawing functions so i'm not sure what you mean. Can you be more clear about what exact functionality you're after?

avatar image Stomper2000 Bunny83 · Mar 29, 2018 at 02:00 AM 0
Share

Actually I mean the Direct2D portion of DirectX on Windows UWP apps. With it I can create a bitmap then draw to that bitmap; lines, splines, rectangles, ellipses, polygons, other bitmaps at different alpha levels. I can then apply an opacity (alpha) mask, of the same type of objects but in 8 bit, over that before it is rendered as a 32 bit bitmap. Basically it is a texture/bitmap that is being drawn to.

From what I looked into in OpenGL it has similar features but is organized in command format.

Thanks

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Mar 29, 2018 at 11:01 PM

Well, I'm still not sure what exactly you mean, however a texture can have an alpha channel which can be used to do alpha blending in a shader. It's usually used for transparency and masking. Unity doesn't have any "functions" to draw lines, rectangle or ellipse shapes, though OpenGL doesn't have them either. You have to create/ draw an actual mesh. Of course those can be procedurally generated. Using appropriate shaders, vertex colors, texture coordinates and textures you can do everything you want.


A camera can be rendered into a RenderTexture. You can also use Graphics.Blit and other low level rendering commands to combine textures on top of each other using a specific shader.


If you need further help you have to get much more concrete about what you want to do. Keep in mind that Unity is a game engine. It uses either DirectX or OpenGL for the lowlevel rendering stuff but it's generally not meant for pure image composition or image editing. However that doesn't mean you can't create the next Photoshop in Unity. It's possible if you invest enough time.

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

76 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 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 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 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 avatar image avatar image avatar image avatar image

Related Questions

Do I need DirectX? 1 Answer

How does Texture2D.CreateExternalTexture work? 1 Answer

No Realtime Lighting on Build in OpenGL 0 Answers

Ripped model requires skinned mesh 1 Answer

DirectX screwing all this up? 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