//**************************************************************************/ // Copyright (c) 2012 Autodesk, Inc. // All rights reserved. // // These coded instructions, statements, and computer programs contain // unpublished proprietary information written by Autodesk, Inc., and are // protected by Federal copyright law. They may not be disclosed to third // parties or copied or duplicated in any form, in whole or in part, without // the prior written consent of Autodesk, Inc. //**************************************************************************/ // // Simple shader to output different colors to different output targets // #include "Common.cgh" // Colors to set for output targets float4 gTargetColor1 < string UIWidget = "Color"; string UIName = "Color For Target 1"; > = {1.0f,0.0f,0.0f,1.0f}; float4 gTargetColor2 < string UIWidget = "Color"; string UIName = "Color For Target 2"; > = {0.0f,1.0f,0.0f,1.0f}; // Output to 2 diferent targets as an example struct PixelShaderOutput { float4 color1 : COLOR0; float4 color2 : COLOR1; }; PixelShaderOutput PS_BlitToMRT(VS_TO_PS_ScreenQuad In) { PixelShaderOutput result; result.color1 = gTargetColor1; result.color2 = gTargetColor2; return result; } technique Main { pass p0 { VertexShader = compile glslv VS_ScreenQuad(); PixelShader = compile glslf PS_BlitToMRT(); } }