当前位置:网站首页>Try to use renderdoc to view the shader code of UE

Try to use renderdoc to view the shader code of UE

2022-06-13 07:00:00 YakSue

problem

stay 《 Learn to use RenderDoc View shader code 》 I learned how to use RenderDoc see shader Code .
stay 《 stay UE4 Use in RenderDoc》 I learned how to do UE4 Use in RenderDoc.
But one problem is , If I'm directly in UE Try to watch the middle frame shader Code , You see assembly instructions that are not readable :
 Insert picture description here
The goal of this article is to try to solve this problem .

Necessary operation :r.Shaders.Optimize and r.Shaders.KeepDebugInfo

By looking up 《UE4 Use in RenderDoc Cut frame - cococ - Blog Garden 》 Information , The two key console variables associated with finding this problem are r.Shaders.Optimize and r.Shaders.KeepDebugInfo.
The expected value is :

r.Shaders.Optimize=0
r.Shaders.KeepDebugInfo=1

These two console variables can be queried when the editor is running , The default value is just the opposite , And it cannot be modified in the editor .
To modify , Will be in \Engine\Config\ConsoleVariables.ini Revision in China .
By default , The assignment statements for both variables are commented out , Just remove their comments :
 Insert picture description here


And then , Then start the engine editor , Cut frame , You can see readable shader Code. :
 Insert picture description here

May not be a necessary step *: Set to Debug?

Because I have heard that , Need to put VS Configuration of the solution ( The original window may be shorter , For the method of lengthening, see 【 appendix 】)
from
 Insert picture description here
Change it to
 Insert picture description here
But I haven't seen any help to this problem since I changed it . Finally, I found that as long as r.Shaders.Optimize and r.Shaders.KeepDebugInfo, Then even in Development You can also see readable shader Code .
So for the time being, I think Debug May not be a necessary step .

however , Set to Debug May be helpful in other ways , So I temporarily recorded the problems encountered .


There was a problem after the switch was turned on :
 Insert picture description here
stay here See the solution , That is, first find a mode that you can enter, and then click File > Cook Content for Windows
 Insert picture description here
wait for Cook complete :
 Insert picture description here
Then replace with Debug start-up , I can't see the error report .

appendix : Make the solution configuration window longer

stay 《 modify VS2017 Solution configuration window width 》 Found a way :

Tools > Customize
 Insert picture description here
command > Select... From the toolbar “ standard ”
choice “ Solution configuration ”
Click on “ Modify the selection ”
 Insert picture description here
Modify width , Then click OK .
 Insert picture description here

原网站

版权声明
本文为[YakSue]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/164/202206130651541060.html

随机推荐