x


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.

more ▼

asked Oct 20 '11 at 09:26 AM

CHPedersen gravatar image

CHPedersen
6k 13 22 61

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

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. ;)

more ▼

answered Sep 14 '12 at 07:47 AM

CHPedersen gravatar image

CHPedersen
6k 13 22 61

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

Apr 04 at 08:16 PM Pensun
(comments are locked)
10|3000 characters needed characters left

Thanks man I too have same Issue. Y nop one have these Problem.

more ▼

answered Nov 27 '12 at 05:47 PM

Yasantha gravatar image

Yasantha
101 1 1 4

(comments are locked)
10|3000 characters needed characters left

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

more ▼

answered Apr 04 at 09:11 PM

Pensun gravatar image

Pensun
0

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1674
x1658
x89
x14
x2

asked: Oct 20 '11 at 09:26 AM

Seen: 1049 times

Last Updated: Apr 04 at 09:11 PM