How to debug a GLSL shader?

Posted skyman_2001

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了How to debug a GLSL shader?相关的知识,希望对你有一定的参考价值。

摘自:http://stackoverflow.com/questions/2508818/how-to-debug-a-glsl-shader


void main()
  float bug=0.0;
  vec3 tile=texture2D(colMap, coords.st).xyz;
  vec4 col=vec4(tile, 1.0);

  if(something) bug=1.0;

  col.x+=bug;

  gl_FragColor=col;

It is a debugging device. If you want to know where the light position is in the scene, for example, go: if(lpos.x>100) bug=1.0. If the light position is greater than 100, the scene will turn red.–  ste3e

以上是关于How to debug a GLSL shader?的主要内容,如果未能解决你的问题,请参考以下文章

How to DEBUG a trigger or procedure

How to debug PostgreSQL function with pgAdminIII

How to debug .NET Core RC2 app with Visual Studio Code on Windows?

How to debug Interaction center inbox workflow WS14000164

How to enable debug in slf4j Logger?

如何 debug nodeJS 代码? how to inspect NodeJS code?