angelwire
Member
I was playing around with applying shaders to 3d games when I ran into a roadblock. I can't find any way to draw 3d objects to different surfaces. What I'd like to be able to do is draw the player's first person view 2 or 3 times with different shaders applied to each, and then combine them in the draw GUI action.
So basically what I'd like to do is something like this pseudocode:
(obviously some parts are missing so it's not so long)
This is basically just some general pseudo code of what I'd like to do, I've tried several different ways but nothing seems to work right.
Is something like this even possible? I've found a complicated workaround using views, but I think that method is pretty slow, and it's definitely not easy to use. I hope I've explained myself well enough, if not I'll be happy to clarify anything.
Thanks for the help.
So basically what I'd like to do is something like this pseudocode:
(obviously some parts are missing so it's not so long)
Code:
set_surface(lighting_surface)
set_shader(lighting_shader)
d3d_draw_model(...)
reset_shader()
surface_reset_target()
set_surface(outline_surface)
set_shader(outline_shader)
d3d_draw_model(...)
reset_shader()
surface_reset_target()
//Draw GUI
draw_surface(lighting_shader)
draw_surface(outline_shader)
Is something like this even possible? I've found a complicated workaround using views, but I think that method is pretty slow, and it's definitely not easy to use. I hope I've explained myself well enough, if not I'll be happy to clarify anything.
Thanks for the help.