Jump to content
  • Advertisement

fdialke

Member
  • Content Count

    5
  • Joined

  • Last visited

Everything posted by fdialke

  1. Hi there.   I've made an application builded on common separate window with some transparent cubes. All looks good, transparent is transparent and so on. Then I've moved all my code to ATL ActiveX Control, and now transparent figure became just textured white (texture has white background) cube.   Why there is so difference ? How can I manage it ?
  2. fdialke

    Direct3D + ActiveX

    well, I've made it work, but don't know why that didn't  I've included SetBlendState right into techinque: technique11 Light2TexTransparent {     pass P0     {         SetVertexShader( CompileShader( vs_5_0, VS_TransparentCube() ) ); SetGeometryShader( NULL ); SetBlendState(EnableBlend, float4( 0.1f, 0.1f, 0.1f, 0.1f ), 0xFFFFFFFF);         SetPixelShader( CompileShader( ps_5_0, PS_TransparentCube(2) ) );     } } BlendState EnableBlend { BlendEnable[0] = TRUE; SrcBlend[0] = 5; DestBlend[0] = 6; BlendOp[0] = 1; SrcBlendAlpha[0] = 2; DestBlendAlpha[0] = 1; BlendOpAlpha[0] = 1; RenderTargetWriteMask[0] = 15; };   may somebody explain me why OMSetBlendState didn't work, but SetBlendState fixed it ?  
  3. fdialke

    Direct3D + ActiveX

    I've made this PS shader now float4 PS_TransparentCube(VertexOut pin, uniform int gLightCount) : SV_Target { // Interpolating normal can unnormalize it, so normalize it.     pin.NormalW = normalize(pin.NormalW); // The toEye vector is used in lighting. float3 toEye = gEyePosW - pin.PosW; // Cache the distance to the eye from this surface point. float distToEye = length(toEye);  // Normalize. toEye /= distToEye;     // Default to multiplicative identity.     float4 texColor = float4(1, 1, 1, 1); // Sample texture. texColor = gTransparentMap.Sample( samAnisotropic, pin.Tex ); texColor.a = 0.1f; return texColor; }   so now cube has no lights, still window application has transparency and ActiveX shows white cube https://imageshack.com/i/5iphbxj https://imageshack.com/i/n5cd97j
  4. fdialke

    Direct3D + ActiveX

    https://imageshack.com/i/m94v69j https://imageshack.com/i/gv46kij md3dImmediateContext->OMSetBlendState(TransparentBS, blendFactor, 0xffffffff); activeTech->GetPassByIndex(p)->Apply(0, md3dImmediateContext); md3dImmediateContext->RSSetState(CCWcullMode); md3dImmediateContext->DrawIndexed(mTransparentVICount, 0, 0); md3dImmediateContext->RSSetState(CWcullMode); md3dImmediateContext->DrawIndexed(mTransparentVICount, 0, 0); md3dImmediateContext->OMSetBlendState(0, blendFactor, 0xffffffff);
  5. Hi there.   I have a scene with some thouthan instances, and i have a texture array; I need to pass to every instance its own array of elements (of that texture array) For example:   1) Texture array has 50 elements 2) Every instance can get his own set of elements, and count of elements can vary for every instance, for example: a) instance 0 get set [1, 20, 40, 38, 16] ?) instance 1 get set [14, 16] ?) instance 2 get set [23, 34, 23] etc A question: how to organize array of D3D11_INPUT_ELEMENT_DESC for passing this stuff into the shader ?   It's clear, that's possible to create a lot of elements in input buffer for maximum number of my elements, but this solution looks very bad ...   to be clear: of course I don't need an input buffer to pass texture array - I've done it through Texture2DArray, but I don't know how to pass an unique set of elements for every instance ...
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!