简体   繁体   中英

How do you create the “Shader” folder in Visual Studio interface

I have seen several projects with the "Shader" folder in the Solution Explorer.

However, when I create one myself, I can only see "Header files", "Source files", "Resource files", and "External dependencies" folder.

Is there a way to tell Visual Studio I need a "Shader" folder because I'm going to use shaders? If not, how can I create it manually?

Visual Studio has virtual folders called "Filters". These can map to real folders in the file system or you can just use them to define logical/conceptual groups of items inside your projects.

To create a filter under a project in Visual Studio, just right-click with the mouse on your project in the Solution Explorer, expand "Add" and click "New Filter". A new filter ("NewFilter1") will be created under your project which you can then rename as you like.

You can drag items from your project inside it in order to group them "logically" or you can right-click on your new filter and choose Add>Existing Item or Add>New Item. You can even nest multiple filters inside each other.

For example in your case, you would call this filter "Shader" and you can drag-and-drop all shader-related files inside it. This only affects your project and not the directory structure in the file system.

You can still create a "real" folder in the file system and then add files into it, which you can then reference in your project's filter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM