Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by Jacktang · Jun 23, 2012 at 04:53 PM · shaderlabopenglnative

Unity Shaders in Native c++ plugin

Hey, I was wondering if there is any way to use Unity shaders when using the low level native rendering interface from a c++ and openGL plugin. I'm doing some rendering from a plugin and wish to integrate it with the lights in my scene. I would rather not have to re-implement all the complex lighting stuff in unity.

From what I can tell if I can't just easily tap into the unity shader pipeline from my native plugin, then I will need to retrieve a list of all the lights affecting my object, make them available to my GLSL shader, and then perform all the correct lighting calculations from my own custom GLSL shader. Any shortcuts around this? Is there a simple way of getting access to all the variables that unity makes available for "free" when writing GLSL shaders in editor?

Ideally I would like to just be able to write a typical ShaderLab shader and pass the GLSL compiled version into my native plugin and just call glUseProgram(program); and have everything magically work, but I'm guessing it's not going to be quite that easy.

Comment
Add comment · Show 1
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 Jessy · Jun 23, 2012 at 05:18 PM 0
Share
  • for good question, -1 for not crosslinking. http://forum.unity3d.com/threads/141005-ShaderLab-shaders-in-native-OpenGL

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by TheLazyEngineer · Dec 22, 2020 at 11:19 PM

ever find your answer on this?

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

clipping shader for OpenGL quad 0 Answers

How do I use advanced OpenGL blend mode ? 0 Answers

External terrain renderer 0 Answers

GLES20: vprog textures are used, but not supported. 1 Answer

How to use Unity3d shader to mask another two-pass shader? 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