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
4
Question by CHPedersen · Oct 20, 2011 at 09:26 AM · shadereditorcgintellisense

Shader Intellisense / Code completion

Hey all,

I use Visual Studio for all my C# scripting, and comfortable as I am, I've grown totally accustomed to the luxury of its intellisense support telling me exactly what's available and what exactly is in scope at any given time, as well as its code-completion. But I recently started studying shader programming, and Visual Studio has no idea what a .shader-file is, so it has no syntax highlighting - it's not even indenting lines after a "{". So now I'm back to playing "Where's Waldo" with compile-time errors whenever I slightly mistyped a variable name again. It's really a "back to the stone age"-experience. I miss having someone hold my hand, damn it! :P

Is anyone aware of a way to get intellisense support for Cg in Visual Studio? Or if that's not possible, perhaps another editor I can run on the side? I just need something that knows what's up and down in Cg as I type. For instance, I'd like to know exactly what is in unitycg.cginc. I understand it defines things like input structs and provides access to stuff like the ModelViewProjection-matrix, but I'd like to see its complete contents. It doesn't seem very well documented.

I searched around and found the Strumpy editor, but that isn't what I'm looking for. I understand shader-code just fine, so a visual drag'n'drop editor that hides it from me is not the goal.

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 CHPedersen · Sep 14, 2012 at 07:47 AM

Since no one else seems to have an answer for this one, I'm going to go ahead and link to this website:

http://unityvs.com/roadmap/

This is a plugin for Unity/Visual Studio which attached Unity's process to Visual Studio's debugger, so you can debug your Unity app in Visual Studio. I think it looks extremely promising. But the part that's related to this question is the topic on the roadmap page I linked to - it says they're going to implement code completion and code coloration for shaders, effectively offering precisely what I asked for in this question.

So, for those of you who write ShaderLab/Cg code and are in dire need of a proper editor for it like myself, look out for this feature. I think I've convinced my boss to purchase a license for us. ;)

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 Pensun · Apr 04, 2013 at 08:16 PM 0
Share

I'm looking forward to this! Has there ever been a code completion solution for shader languages?

In the interim, at least you can do this: http://forum.unity3d.com/threads/108995-Tutorial-How-to-use-NShader-with-Unity-shaders

avatar image
0

Answer by Pensun · Apr 04, 2013 at 09:11 PM

I'm looking forward to this! Has there ever been a code completion solution for shader languages?

In the interim, at least you can do this: http://forum.unity3d.com/threads/108995-Tutorial-How-to-use-NShader-with-Unity-shaders

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 Cambesa · Oct 12, 2015 at 02:21 PM 0
Share

For everyone who is still looking this up, a tool is released which auto-completes .shader, .cginc and .compute files in Visual Studio 2013 https://visualstudiogallery.msdn.microsoft.com/ed812631-a7d3-4ca3-9f84-7efb240c7bb5

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

6 People are following this question.

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

Related Questions

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

How to determine shader center? 0 Answers

Remove/Disable built in shaders (from menu)? 1 Answer

Assign texture to shader bypassing material (in Unity Editor) 1 Answer

Inverted Normals in Player, correct in Editor? 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