I studying the CG book of NVidia, and the CG Book of wikibook, but any of those describe how compile and run a shader (in directX or openGL). I’m having some difficult in find some material about this.
If I understand, I need to do a program thats run in my CPU and call for my vertex/fragment shader to be compiled in GPU?
How can I do the GPU compile and run my shaders?
CG is a dead language; you should really be looking at GLSL or HLSL.
Also, you don’t really “run a shader”. Your program tells the API in question to compile shaders, and you execute a rendering command that uses shaders to do part of the rendering operation. You can “run” a compute shader, but even that is just a variation of a rendering operation.
I really suggest encourage You to check out Cherno’s playlist about openGl .
It really explains it all and he actually shows how to deal with shaders in very good way and overall how to deal with many basic concepts of opengl.