Arkanoid

Members
  • Content count

    59
  • Joined

  • Last visited

Community Reputation

109 Neutral

About Arkanoid

  • Rank
    Member
  1. Hi, sb know how to change mesh positions in directx? I tried like this: D3DXMATRIX m2; D3DXMatrixTranslation(&m2, x, y, z ); g_pd3dDevice->SetTransform( D3DTS_WORLD, &m2 ); then render...... and g_pd3dDevice->SetTransform( D3DTS_WORLD, &m1 ); but it doesn't work, mesh is still on it start posotion.
  2. Correct X file export from 3ds Max

    how about "include animation"? with this settings i have model, without texture and animation....even if "include animation" checked. if i chek using full texture filename - i can see textures. But no animation. I see animation if i chek include bones, but then there is no mesh, just bone meshes with animation [img]http://public.gamedev.net//public/style_emoticons/default/wacko.png[/img]
  3. Correct X file export from 3ds Max

    2009 max....no, with that settings my program doesn't see animation and textures.... if i click "bones" on - i have bones objects - but with animation)))) better to have object with animation)))
  4. Correct X file export from 3ds Max

    "right options" - ?))
  5. Hi, sb know how using panda directX exporter, export x file? I have problems with model in directX code. Some models are witout textures, some witout animation. How correctly export model to X. file? Mostly i'm interesting in animated models export.
  6. Animation in D3D

    i understand where was the problem...when i add it it to the project i must delete [CODE]#include "Utility.cpp"[/CODE] thx for help))
  7. Animation in D3D

    I added it in the list where is main.cpp.. And if i open classes window i can see that functions in the list. And i can see there CUtility class.
  8. Animation in D3D

    [CODE] #include "Utility.h" #include "Utility.cpp" [/CODE] i have this error: [CODE]error LNK2005: "public: static char * __cdecl CUtility::DuplicateCharString[/CODE] for all utility functions.
  9. HI, i started to learn animation from this sample: [url="http://www.toymaker.info/Games/html/load_x_hierarchy.html"]http://www.toymaker.info/Games/html/load_x_hierarchy.html[/url] There is no problem to understand how animation works, but i have very BIG problem with using that code in my projects... There is a structure CGraphics that contains everything, i just try to use animation without that class. So about the problem: project contains all files in two parts .h and .cpp in the sample - everything works good, but if i add this files in my project: [CODE]#include "XfileEntity.h" #include "Utility.h"[/CODE] i have errors like this : : error LNK2019: public: static void __cdecl CUtility::DebugString why? How shoud i add that files to project correctly?
  10. Glow Effect

    [quote name='Adam_42' timestamp='1335047208' post='4933624'] You do. I'd suggest starting with something simpler to get to know the basics of how shaders work. [/quote] i have already started) But to write a big shader code, i need to know 100% its code...so i wanna try to create shaders in special program and then use it. Its in my opinion good way to get 100% working code... So if i understood, i need to set that textures from code, cause in another case i have devision by zero.... P.S. I still cannot understand one thing - how to get texture size?
  11. Glow Effect

    i saw nothing...no objects...hm all texture coordinates in PIX after shader are like this: [CODE]1.#IO [/CODE]P.S. And i have strange problem with program and in PIX...PIX sad that program run out of memory....[img]http://public.gamedev.net//public/style_emoticons/default/wacko.png[/img]
  12. Glow Effect

    Hi, i downloaded one Program, FX Composer, to try to create shaders, and create there glow shader. Then i copied fx. file to my program and view was clear...i tried to debug it with PIX and saw that something strange happened with textures...this is the shader: [CODE]#define WT_0 1.0 #define WT_1 0.8 #define WT_2 0.6 #define WT_3 0.4 #define WT_4 0.2 // these ones are based on the above.... #define WT_NORMALIZE (WT_0+2.0*(WT_1+WT_2+WT_3+WT_4)) #define KW_0 (WT_0/WT_NORMALIZE) #define KW_1 (WT_1/WT_NORMALIZE) #define KW_2 (WT_2/WT_NORMALIZE) #define KW_3 (WT_3/WT_NORMALIZE) #define KW_4 (WT_4/WT_NORMALIZE) float Script : STANDARDSGLOBAL < string UIWidget = "none"; string ScriptClass = "scene"; string ScriptOrder = "postprocess"; string ScriptOutput = "color"; string Script = "Technique=Glow?Main:Main10;"; > = 0.8; // Standard full-screen imaging value float4 ClearColor < string UIWidget = "color"; string UIName = "Clear (Bg) Color"; > = {0,0,0,1.0}; float ClearDepth < string UIWidget = "None"; > = 1.0; float2 ViewportSize : VIEWPORTPIXELSIZE < string UIName="Screen Size"; string UIWidget="None"; >; static float2 ViewportOffset = (float2(0.5,0.5)/ViewportSize); /////////////////////////////////////////////////////////// /////////////////////////////////////// Tweakables //////// /////////////////////////////////////////////////////////// float Glowness < string UIName = "Glow Strength"; string UIWidget = "slider"; float UIMin = 0.0f; float UIMax = 2.0f; float UIStep = 0.05f; > = 0.7f; float Sceneness < string UIName = "Scene Strength"; string UIWidget = "slider"; float UIMin = 0.0f; float UIMax = 2.0f; float UIStep = 0.05f; > = 0.3f; float GlowSpan < string UIName = "Glow Step Size (Texels)"; string UIWidget = "slider"; float UIMin = 0.2f; float UIMax = 8.0f; float UIStep = 0.5f; > = 2.5f; /////////////////////////////////////////////////////////// ///////////////////////////// Render-to-Texture Targets /// /////////////////////////////////////////////////////////// texture2D ScnMap : RENDERCOLORTARGET < float2 ViewPortRatio = {1.0,1.0}; int MipLevels = 1; string Format = "X8R8G8B8" ; string UIWidget = "None"; >; sampler2D ScnSamp = sampler_state { texture = <ScnMap>; AddressU = CLAMP; AddressV = CLAMP; FILTER = MIN_MAG_LINEAR_MIP_POINT; }; texture2D GlowMap1 : RENDERCOLORTARGET < float2 ViewPortRatio = {1.0,1.0}; int MipLevels = 1; string Format = "X8R8G8B8" ; string UIWidget = "None"; >; sampler2D GlowSamp1 = sampler_state { texture = <GlowMap1>; AddressU = CLAMP; AddressV = CLAMP; FILTER = MIN_MAG_LINEAR_MIP_POINT; }; texture2D GlowMap2 : RENDERCOLORTARGET < float2 ViewPortRatio = {1.0,1.0}; int MipLevels = 1; string Format = "X8R8G8B8" ; string UIWidget = "None"; >; sampler2D GlowSamp2 = sampler_state { texture = <GlowMap2>; AddressU = CLAMP; AddressV = CLAMP; FILTER = MIN_MAG_LINEAR_MIP_POINT; }; texture2D DepthBuffer : RENDERDEPTHSTENCILTARGET < float2 ViewPortRatio = {1.0,1.0}; string Format = "D24S8"; string UIWidget = "None"; >; /////////////////////////////////////////////////////////// ///////////////////////////// Connector Data Struct /////// /////////////////////////////////////////////////////////// struct OneTexelVertex { float4 Position : POSITION; float2 UV : TEXCOORD0; }; // nine texcoords, to sample nine in-line texels struct NineTexelVertex { float4 Position : POSITION; float2 UV : TEXCOORD0; float4 UV1 : TEXCOORD1; // xy AND zw used as UV coords float4 UV2 : TEXCOORD2; // xy AND zw used as UV coords float4 UV3 : TEXCOORD3; // xy AND zw used as UV coords float4 UV4 : TEXCOORD4; // xy AND zw used as UV coords }; /////////////////////////////////////////////////////////// /////////////////////////////////// Vertex Shaders //////// /////////////////////////////////////////////////////////// // vertex shader to align blur samples vertically NineTexelVertex vert9BlurVS( float3 Position : POSITION, float2 UV : TEXCOORD0 ) { NineTexelVertex OUT = (NineTexelVertex)0; OUT.Position = float4(Position, 1); float TexelIncrement = GlowSpan/ViewportSize.y; float2 Coord = float2(UV.xy + ViewportOffset); OUT.UV = Coord; OUT.UV1 = float4(Coord.x, Coord.y + TexelIncrement, Coord.x, Coord.y - TexelIncrement); OUT.UV2 = float4(Coord.x, Coord.y + TexelIncrement*2, Coord.x, Coord.y - TexelIncrement*2); OUT.UV3 = float4(Coord.x, Coord.y + TexelIncrement*3, Coord.x, Coord.y - TexelIncrement*3); OUT.UV4 = float4(Coord.x, Coord.y + TexelIncrement*4, Coord.x, Coord.y - TexelIncrement*4); return OUT; } // vertex shader to align blur samples horizontally NineTexelVertex horiz9BlurVS( float3 Position : POSITION, float2 UV : TEXCOORD0 ) { NineTexelVertex OUT = (NineTexelVertex)0; OUT.Position = float4(Position, 1); float TexelIncrement = GlowSpan/ViewportSize.x; float2 Coord = float2(UV.xy + ViewportOffset); OUT.UV = Coord; OUT.UV1 = float4(Coord.x + TexelIncrement, Coord.y, Coord.x - TexelIncrement, Coord.y); OUT.UV2 = float4(Coord.x + TexelIncrement*2, Coord.y, Coord.x - TexelIncrement*2, Coord.y); OUT.UV3 = float4(Coord.x + TexelIncrement*3, Coord.y, Coord.x - TexelIncrement*3, Coord.y); OUT.UV4 = float4(Coord.x + TexelIncrement*4, Coord.y, Coord.x - TexelIncrement*4, Coord.y); return OUT; } OneTexelVertex ScreenQuadVS( float3 Position : POSITION, float2 UV : TEXCOORD0 ) { OneTexelVertex OUT = (OneTexelVertex)0; OUT.Position = float4(Position, 1); OUT.UV = float2(UV.xy + ViewportOffset); return OUT; } /////////////////////////////////////////////////////////// /////////////////////////////////// Pixel Shaders ///////// /////////////////////////////////////////////////////////// float4 blur9PS(NineTexelVertex IN, uniform sampler2D SrcSamp) : COLOR { float4 OutCol = tex2D(SrcSamp, IN.UV4.zw) * KW_4; OutCol += tex2D(SrcSamp, IN.UV3.zw) * KW_3; OutCol += tex2D(SrcSamp, IN.UV2.zw) * KW_2; OutCol += tex2D(SrcSamp, IN.UV1.zw) * KW_1; OutCol += tex2D(SrcSamp, IN.UV) * KW_0; OutCol += tex2D(SrcSamp, IN.UV1.xy) * KW_1; OutCol += tex2D(SrcSamp, IN.UV2.xy) * KW_2; OutCol += tex2D(SrcSamp, IN.UV3.xy) * KW_3; OutCol += tex2D(SrcSamp, IN.UV4.xy) * KW_4; return OutCol; } // add glow on top of model float4 PS_GlowPass(OneTexelVertex IN) : COLOR { float4 scn = Sceneness * tex2D(ScnSamp, IN.UV); float3 glow = Glowness * tex2D(GlowSamp2, IN.UV).xyz; return float4(scn.xyz+glow,scn.w); } //////////////////////////////////////////////////////////// /////////////////////////////////////// techniques ///////// //////////////////////////////////////////////////////////// RasterizerState DisableCulling { CullMode = NONE; }; DepthStencilState DepthEnabling { DepthEnable = FALSE; DepthWriteMask = ZERO; }; BlendState DisableBlend { BlendEnable[0] = FALSE; }; technique10 Main10 < string Script = "RenderColorTarget0=ScnMap;" "RenderDepthStencilTarget=DepthBuffer;" "ClearSetColor=ClearColor;" "ClearSetDepth=ClearDepth;" "Clear=Color;" "Clear=Depth;" "ScriptExternal=color;" "Pass=BlurGlowBuffer_Horz;" "Pass=BlurGlowBuffer_Vert;" "Pass=GlowPass;"; > { pass BlurGlowBuffer_Horz < string Script = "RenderColorTarget=GlowMap1;" "RenderDepthStencilTarget=DepthBuffer;" "Draw=Buffer;"; > { SetVertexShader( CompileShader( vs_4_0, horiz9BlurVS() ) ); SetGeometryShader( NULL ); SetPixelShader( CompileShader( ps_4_0, blur9PS(ScnSamp) ) ); SetRasterizerState(DisableCulling); SetDepthStencilState(DepthEnabling, 0); SetBlendState(DisableBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF); } pass BlurGlowBuffer_Vert < string Script = "RenderColorTarget=GlowMap2;" "RenderDepthStencilTarget=DepthBuffer;" "Draw=Buffer;"; > { SetVertexShader( CompileShader( vs_4_0, vert9BlurVS() ) ); SetGeometryShader( NULL ); SetPixelShader( CompileShader( ps_4_0, blur9PS(GlowSamp1) ) ); SetRasterizerState(DisableCulling); SetDepthStencilState(DepthEnabling, 0); SetBlendState(DisableBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF); } pass GlowPass < string Script= "RenderColorTarget0=;" "RenderDepthStencilTarget=;" "Draw=Buffer;"; > { SetVertexShader( CompileShader( vs_4_0, ScreenQuadVS() ) ); SetGeometryShader( NULL ); SetPixelShader( CompileShader( ps_4_0, PS_GlowPass() ) ); SetRasterizerState(DisableCulling); SetDepthStencilState(DepthEnabling, 0); SetBlendState(DisableBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF); } } technique Main < string Script = "RenderColorTarget0=ScnMap;" "RenderDepthStencilTarget=DepthBuffer;" "ClearSetColor=ClearColor;" "ClearSetDepth=ClearDepth;" "Clear=Color;" "Clear=Depth;" "ScriptExternal=color;" "Pass=BlurGlowBuffer_Horz;" "Pass=BlurGlowBuffer_Vert;" "Pass=GlowPass;"; > { pass BlurGlowBuffer_Horz < string Script = "RenderColorTarget=GlowMap1;" "RenderDepthStencilTarget=DepthBuffer;" "Draw=Buffer;"; > { VertexShader = compile vs_3_0 horiz9BlurVS(); cullmode = none; ZEnable = false; ZWriteEnable = false; AlphaBlendEnable = false; PixelShader = compile ps_3_0 blur9PS(ScnSamp); } pass BlurGlowBuffer_Vert < string Script = "RenderColorTarget=GlowMap2;" "RenderDepthStencilTarget=DepthBuffer;" "Draw=Buffer;"; > { VertexShader = compile vs_3_0 vert9BlurVS(); cullmode = none; ZEnable = false; ZWriteEnable = false; AlphaBlendEnable = false; PixelShader = compile ps_3_0 blur9PS(GlowSamp1); } pass GlowPass < string Script= "RenderColorTarget0=;" "RenderDepthStencilTarget=;" "Draw=Buffer;"; > { cullmode = none; ZEnable = false; ZWriteEnable = false; AlphaBlendEnable = false; VertexShader = compile vs_3_0 ScreenQuadVS(); PixelShader = compile ps_3_0 PS_GlowPass(); } }[/CODE] meybe i need to set some globals from code? [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img] Cause i cannot find anything that i need to set from code here...and don't know how to see it in FX Composer...
  13. Glow Effect

    I downloaded one Program, FX Composer, to try to create shaders, and create there glow shader. Then i copied fx. file to my program and view was clear...i tried to debug it with PIX and saw that something strange happened with textures...this is the shader: [CODE]#define WT_0 1.0 #define WT_1 0.8 #define WT_2 0.6 #define WT_3 0.4 #define WT_4 0.2 // these ones are based on the above.... #define WT_NORMALIZE (WT_0+2.0*(WT_1+WT_2+WT_3+WT_4)) #define KW_0 (WT_0/WT_NORMALIZE) #define KW_1 (WT_1/WT_NORMALIZE) #define KW_2 (WT_2/WT_NORMALIZE) #define KW_3 (WT_3/WT_NORMALIZE) #define KW_4 (WT_4/WT_NORMALIZE) float Script : STANDARDSGLOBAL < string UIWidget = "none"; string ScriptClass = "scene"; string ScriptOrder = "postprocess"; string ScriptOutput = "color"; string Script = "Technique=Glow?Main:Main10;"; > = 0.8; // Standard full-screen imaging value float4 ClearColor < string UIWidget = "color"; string UIName = "Clear (Bg) Color"; > = {0,0,0,1.0}; float ClearDepth < string UIWidget = "None"; > = 1.0; float2 ViewportSize : VIEWPORTPIXELSIZE < string UIName="Screen Size"; string UIWidget="None"; >; static float2 ViewportOffset = (float2(0.5,0.5)/ViewportSize); /////////////////////////////////////////////////////////// /////////////////////////////////////// Tweakables //////// /////////////////////////////////////////////////////////// float Glowness < string UIName = "Glow Strength"; string UIWidget = "slider"; float UIMin = 0.0f; float UIMax = 2.0f; float UIStep = 0.05f; > = 0.7f; float Sceneness < string UIName = "Scene Strength"; string UIWidget = "slider"; float UIMin = 0.0f; float UIMax = 2.0f; float UIStep = 0.05f; > = 0.3f; float GlowSpan < string UIName = "Glow Step Size (Texels)"; string UIWidget = "slider"; float UIMin = 0.2f; float UIMax = 8.0f; float UIStep = 0.5f; > = 2.5f; /////////////////////////////////////////////////////////// ///////////////////////////// Render-to-Texture Targets /// /////////////////////////////////////////////////////////// texture2D ScnMap : RENDERCOLORTARGET < float2 ViewPortRatio = {1.0,1.0}; int MipLevels = 1; string Format = "X8R8G8B8" ; string UIWidget = "None"; >; sampler2D ScnSamp = sampler_state { texture = <ScnMap>; AddressU = CLAMP; AddressV = CLAMP; FILTER = MIN_MAG_LINEAR_MIP_POINT; }; texture2D GlowMap1 : RENDERCOLORTARGET < float2 ViewPortRatio = {1.0,1.0}; int MipLevels = 1; string Format = "X8R8G8B8" ; string UIWidget = "None"; >; sampler2D GlowSamp1 = sampler_state { texture = <GlowMap1>; AddressU = CLAMP; AddressV = CLAMP; FILTER = MIN_MAG_LINEAR_MIP_POINT; }; texture2D GlowMap2 : RENDERCOLORTARGET < float2 ViewPortRatio = {1.0,1.0}; int MipLevels = 1; string Format = "X8R8G8B8" ; string UIWidget = "None"; >; sampler2D GlowSamp2 = sampler_state { texture = <GlowMap2>; AddressU = CLAMP; AddressV = CLAMP; FILTER = MIN_MAG_LINEAR_MIP_POINT; }; texture2D DepthBuffer : RENDERDEPTHSTENCILTARGET < float2 ViewPortRatio = {1.0,1.0}; string Format = "D24S8"; string UIWidget = "None"; >; /////////////////////////////////////////////////////////// ///////////////////////////// Connector Data Struct /////// /////////////////////////////////////////////////////////// struct OneTexelVertex { float4 Position : POSITION; float2 UV : TEXCOORD0; }; // nine texcoords, to sample nine in-line texels struct NineTexelVertex { float4 Position : POSITION; float2 UV : TEXCOORD0; float4 UV1 : TEXCOORD1; // xy AND zw used as UV coords float4 UV2 : TEXCOORD2; // xy AND zw used as UV coords float4 UV3 : TEXCOORD3; // xy AND zw used as UV coords float4 UV4 : TEXCOORD4; // xy AND zw used as UV coords }; /////////////////////////////////////////////////////////// /////////////////////////////////// Vertex Shaders //////// /////////////////////////////////////////////////////////// // vertex shader to align blur samples vertically NineTexelVertex vert9BlurVS( float3 Position : POSITION, float2 UV : TEXCOORD0 ) { NineTexelVertex OUT = (NineTexelVertex)0; OUT.Position = float4(Position, 1); float TexelIncrement = GlowSpan/ViewportSize.y; float2 Coord = float2(UV.xy + ViewportOffset); OUT.UV = Coord; OUT.UV1 = float4(Coord.x, Coord.y + TexelIncrement, Coord.x, Coord.y - TexelIncrement); OUT.UV2 = float4(Coord.x, Coord.y + TexelIncrement*2, Coord.x, Coord.y - TexelIncrement*2); OUT.UV3 = float4(Coord.x, Coord.y + TexelIncrement*3, Coord.x, Coord.y - TexelIncrement*3); OUT.UV4 = float4(Coord.x, Coord.y + TexelIncrement*4, Coord.x, Coord.y - TexelIncrement*4); return OUT; } // vertex shader to align blur samples horizontally NineTexelVertex horiz9BlurVS( float3 Position : POSITION, float2 UV : TEXCOORD0 ) { NineTexelVertex OUT = (NineTexelVertex)0; OUT.Position = float4(Position, 1); float TexelIncrement = GlowSpan/ViewportSize.x; float2 Coord = float2(UV.xy + ViewportOffset); OUT.UV = Coord; OUT.UV1 = float4(Coord.x + TexelIncrement, Coord.y, Coord.x - TexelIncrement, Coord.y); OUT.UV2 = float4(Coord.x + TexelIncrement*2, Coord.y, Coord.x - TexelIncrement*2, Coord.y); OUT.UV3 = float4(Coord.x + TexelIncrement*3, Coord.y, Coord.x - TexelIncrement*3, Coord.y); OUT.UV4 = float4(Coord.x + TexelIncrement*4, Coord.y, Coord.x - TexelIncrement*4, Coord.y); return OUT; } OneTexelVertex ScreenQuadVS( float3 Position : POSITION, float2 UV : TEXCOORD0 ) { OneTexelVertex OUT = (OneTexelVertex)0; OUT.Position = float4(Position, 1); OUT.UV = float2(UV.xy + ViewportOffset); return OUT; } /////////////////////////////////////////////////////////// /////////////////////////////////// Pixel Shaders ///////// /////////////////////////////////////////////////////////// float4 blur9PS(NineTexelVertex IN, uniform sampler2D SrcSamp) : COLOR { float4 OutCol = tex2D(SrcSamp, IN.UV4.zw) * KW_4; OutCol += tex2D(SrcSamp, IN.UV3.zw) * KW_3; OutCol += tex2D(SrcSamp, IN.UV2.zw) * KW_2; OutCol += tex2D(SrcSamp, IN.UV1.zw) * KW_1; OutCol += tex2D(SrcSamp, IN.UV) * KW_0; OutCol += tex2D(SrcSamp, IN.UV1.xy) * KW_1; OutCol += tex2D(SrcSamp, IN.UV2.xy) * KW_2; OutCol += tex2D(SrcSamp, IN.UV3.xy) * KW_3; OutCol += tex2D(SrcSamp, IN.UV4.xy) * KW_4; return OutCol; } // add glow on top of model float4 PS_GlowPass(OneTexelVertex IN) : COLOR { float4 scn = Sceneness * tex2D(ScnSamp, IN.UV); float3 glow = Glowness * tex2D(GlowSamp2, IN.UV).xyz; return float4(scn.xyz+glow,scn.w); } //////////////////////////////////////////////////////////// /////////////////////////////////////// techniques ///////// //////////////////////////////////////////////////////////// RasterizerState DisableCulling { CullMode = NONE; }; DepthStencilState DepthEnabling { DepthEnable = FALSE; DepthWriteMask = ZERO; }; BlendState DisableBlend { BlendEnable[0] = FALSE; }; technique10 Main10 < string Script = "RenderColorTarget0=ScnMap;" "RenderDepthStencilTarget=DepthBuffer;" "ClearSetColor=ClearColor;" "ClearSetDepth=ClearDepth;" "Clear=Color;" "Clear=Depth;" "ScriptExternal=color;" "Pass=BlurGlowBuffer_Horz;" "Pass=BlurGlowBuffer_Vert;" "Pass=GlowPass;"; > { pass BlurGlowBuffer_Horz < string Script = "RenderColorTarget=GlowMap1;" "RenderDepthStencilTarget=DepthBuffer;" "Draw=Buffer;"; > { SetVertexShader( CompileShader( vs_4_0, horiz9BlurVS() ) ); SetGeometryShader( NULL ); SetPixelShader( CompileShader( ps_4_0, blur9PS(ScnSamp) ) ); SetRasterizerState(DisableCulling); SetDepthStencilState(DepthEnabling, 0); SetBlendState(DisableBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF); } pass BlurGlowBuffer_Vert < string Script = "RenderColorTarget=GlowMap2;" "RenderDepthStencilTarget=DepthBuffer;" "Draw=Buffer;"; > { SetVertexShader( CompileShader( vs_4_0, vert9BlurVS() ) ); SetGeometryShader( NULL ); SetPixelShader( CompileShader( ps_4_0, blur9PS(GlowSamp1) ) ); SetRasterizerState(DisableCulling); SetDepthStencilState(DepthEnabling, 0); SetBlendState(DisableBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF); } pass GlowPass < string Script= "RenderColorTarget0=;" "RenderDepthStencilTarget=;" "Draw=Buffer;"; > { SetVertexShader( CompileShader( vs_4_0, ScreenQuadVS() ) ); SetGeometryShader( NULL ); SetPixelShader( CompileShader( ps_4_0, PS_GlowPass() ) ); SetRasterizerState(DisableCulling); SetDepthStencilState(DepthEnabling, 0); SetBlendState(DisableBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF); } } technique Main < string Script = "RenderColorTarget0=ScnMap;" "RenderDepthStencilTarget=DepthBuffer;" "ClearSetColor=ClearColor;" "ClearSetDepth=ClearDepth;" "Clear=Color;" "Clear=Depth;" "ScriptExternal=color;" "Pass=BlurGlowBuffer_Horz;" "Pass=BlurGlowBuffer_Vert;" "Pass=GlowPass;"; > { pass BlurGlowBuffer_Horz < string Script = "RenderColorTarget=GlowMap1;" "RenderDepthStencilTarget=DepthBuffer;" "Draw=Buffer;"; > { VertexShader = compile vs_3_0 horiz9BlurVS(); cullmode = none; ZEnable = false; ZWriteEnable = false; AlphaBlendEnable = false; PixelShader = compile ps_3_0 blur9PS(ScnSamp); } pass BlurGlowBuffer_Vert < string Script = "RenderColorTarget=GlowMap2;" "RenderDepthStencilTarget=DepthBuffer;" "Draw=Buffer;"; > { VertexShader = compile vs_3_0 vert9BlurVS(); cullmode = none; ZEnable = false; ZWriteEnable = false; AlphaBlendEnable = false; PixelShader = compile ps_3_0 blur9PS(GlowSamp1); } pass GlowPass < string Script= "RenderColorTarget0=;" "RenderDepthStencilTarget=;" "Draw=Buffer;"; > { cullmode = none; ZEnable = false; ZWriteEnable = false; AlphaBlendEnable = false; VertexShader = compile vs_3_0 ScreenQuadVS(); PixelShader = compile ps_3_0 PS_GlowPass(); } }[/CODE] meybe i need to set some globals from code? [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img]
  14. Alpha channel

    Well i changed everything to effect files....and try it with my Vertex Shader - and it work. Then i add your PS and have same result....i give shader my textures now maybe correctly: [CODE] Effect->SetTexture("colortex",LOCATIONS[b].g_pMeshTextures[i]); Effect->SetTexture("alphatex",LOCATIONS[b].g_pMeshTextures[i]); [/CODE] but no result...you sure that your PS is correct? PS changed lighting a bit, but don't hide black parts of textures [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img]
  15. Alpha channel

    As i know we can set only textures with numbers 0,1,2... then we can for example use it texture coordinates,but how to use its pixels? Or change its pixels alpha? [CODE]g_pd3dDevice->SetTexture( 0,LOCATIONS[b].g_pMeshTextures[i] );[/CODE] and shader code: [CODE]float2 tc : TEXCOORD0;[/CODE] - this i can know grom 0 texture....but for use pixels i'ii need samplers? and Texture2D? If i'll chage VS and PS to FX files, can give textures to shader then?Cause if i understand in VS&PS its impossible...or more uncomfortable...