Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

183 Neutral

About iSmokiieZz

  • Rank
  1. iSmokiieZz

    Blending two images together.

    You talked about blending images in the way, that the second image color is subtracted from the previous one. On that site, what is done is alpha blending. These are different things. Sorry, but what exactly is your goal? Pixel rejection might well be an issue, but what is strange here, is that in his post of 05 March 2015 - 03:15 Pm, I do see the vines (the second texture). This let's me assume that all of the second geometry pixels are drawn.
  2. iSmokiieZz

    Game rendering issue

    Just had a look at them. The image of the tutorial (I took the one from his github) seems to be 32bit png, thus having an alpha channel. The monster ones are 24bit, w/o alpha. I don't know much about java gui stuff, but drawImage() might do a bitblt to convert the BufferedImage pixel-by-pixel if the image color depth doesn't match with the desired one. You could try converting one of these monster spritesheets to a 32bit image and see if it works faster.
  3. iSmokiieZz

    Blending two images together.

     Assuming you have a blendstate mb with BlendEnable=FALSE: activeTech->GetPassByIndex(p)->Apply(0, md3dImmediateContext); Effects::BasicFX->SetDiffuseMap(mDiffuseMapSRV); md3dImmediateContext->OMSetBlendState(mb, blendFactor, 0xffffffff); // <<======== md3dImmediateContext->DrawIndexed(mBoxIndexCount, mBoxIndexOffset, mBoxVertexOffset); Effects::BasicFX->SetDiffuseMap(mDiffuseMapSRV2); md3dImmediateContext->OMSetBlendState(mb2, blendFactor, 0xffffffff); //activeTech->GetPassByIndex(p)->Apply(0, md3dImmediateContext); not required md3dImmediateContext->DrawIndexed(mBoxIndexCount, mBoxIndexOffset, mBoxVertexOffset);  If you only see the brick texture with this, your second texture (mDiffuseMapSRV2) might be wrong. Either it doesn't get loaded properly or all RGB channels are empty. If you like, you may attach your second texture. If you use a Visual Studio with Graphics Diagnostics Tools, you may also capture a frame and attach the vsglog.
  4. iSmokiieZz

    Blending two images together.

    I don't see you setting the opaque (no-blend) blendstate. In the second frame you render your first pass with the blend shader then, which is obviously not what you want ;) The object is blue then, because it blends with the clear color, which is blue. Also, what ist your blendFactor?
  5. iSmokiieZz

    Blending two images together.

    What happens if you render the bricks only? Make sure to render the Bricks in the first pass and the vines afterwards. Try inverting the grayscale vines texture. Also, calling Apply() after the first DrawIndexed call looks not correct. 
  6. iSmokiieZz

    Blending two images together.

    You have to create separate Blend states, not use the RenderTarget[] array in the blend desc. Also your blend desc is wrong for the second pass. See my last post. Your have to render the vines with BlendOp=BLEND_OP_REV_SUBTRACT (which is different from BLEND_OP_SUBTRACT), or render the vines first, then the bricks with BLEND_OP_SUBTRACT.
  7. iSmokiieZz

    Blending two images together.

    Well the principle of multipass rendering is that you set some drawing information (blend state, texture maps/DiffuseMap, Transformation), render a geometry (DrawIndexed), set some other draw information and render the geometry again. You don't really need Effect passes for that. Just set a different texture and blendstate, then render the geometry. Do this twice. 0. Set transformation, VBs and IBs. (Btw: 16Bit / R16 Index Bufers are often enough and save half of the data) 1. Set opaque blend state (BlendEnable=FALSE) and your brick texture 2. DrawIndexed() 3. Set "transparent" BS (srcBlend=ONE, dstBlend=ONE, blendOp=BLEND_OP_REV_SUBTRACT) and your vines texture 4. DrawIndexed()
  8. iSmokiieZz

    Blending two images together.

    Your problem is, that your vine value is in the alpha channel solely, because you cannot use only the alpha channel as all color components in fixed-function blending.   I can think of these solutions: - Actually put vines into (grayscale) separate texture. Then, render the brick tex in a first pass and the vines in a second one with the same geometry and blendOp=BLEND_OP_REV_SUBTRACT, srcBlend=BLEND_ONE, dstBlend=BLEND_ONE   - Do blending in the Pixel Shader instead. There you can extract the alpha channel and subtract it from the other color components. If you have to render the vines in an extra pass, just use BLEND_OP_REV_SUBTRACT and output (a, a, a) in the Pixel shader, where a is the alpha value of the texture.   Hope i could help.
  9. iSmokiieZz

    Placing enemies in the map/world

    IMHO this is rather a game design question, instead of how it is achieved.   Do you want a scripted game, such that everytime you play it, you have to fight against the same enemies? Then maybe use a scripting approach (like using Lua, JS, C#, ...). You could also even write your own Game "World"-Editor.   As you mentioned - you could also go the random-Wave path. If this is too 'insconsistent' for you, you could try to parametrize those waves (delay until next wave, change in difficulty / enemy count, ...). You could even merge this idea with the previous idea: fully scripted waves. To test, you could then create an ingame command for reloading the script/level. For that script you could for example put per-wave parameters separated into a simple text file.   BUT There is a lot more you can do about this. It's your decision. I hope I could give some helpful ideas :)
  10. iSmokiieZz

    Questions with GLSL Shaders

    You set these values in the VS per-vertex and their values get interpolated over the primitive (e.g. triangle). In the PS (Fragmentshader) you then access the interpolated value.
  • 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!