Pixel shader - override

Started by
2 comments, last by James Trotter 18 years, 6 months ago
Hi, Is it possible to overide at run time the pixel shader of a game? Which part of the game has the shader / load the shader? Is it the game application or game engine? How many time a typical game switch shadre and when? Is it possible within the shader to know if I am on the "odd" or "even" frame Thanks Raz
Advertisement
Whew a lot of little questions there.

Yes you can enable and disable shaders at run time. If fact it's a rare occurrence for everything to use the same shader in a game/application. You may load and enable them anywhere you like (obviously not in the middle of drawing a polygon or something like that).

You can pass data into the shader, so sure, its possible to let it know if its on an even or odd frame.
I think he's trying to change the pixels shader of an EXISTING game.
My guess is that he wants to disable drawing every second frame or so to make a "see through wall" hack ;)
Quote:Original post by eq
I think he's trying to change the pixels shader of an EXISTING game.
My guess is that he wants to disable drawing every second frame or so to make a "see through wall" hack ;)


This should be possible only if you have a handle to the rendering context.

But to answer one of the original questions. A game might switch shaders several times per frame, typically once per material rendered on the screen. Any more exact than that, or how many materials, or whatever, really depends on the game.

This topic is closed to new replies.

Advertisement