|
Post by u9 on Oct 28, 2006 20:33:23 GMT -5
Now that I'm on the subject of particle systems. It would be nice to be able to set blending options when rendering images in Brutus... We could make some special effects using different blend options. Now I don't mean blend options for the particle emitters only, but also for the normal images.
I came to think of this when I was contemplating creating a new particle emitter as I cannot move Brutus' particles that are emitted.
|
|
|
Post by Guilect on Oct 29, 2006 10:22:03 GMT -5
There is a super secret command already in version 1.4.x of Brutus for setting the blend option. graphics.SetRenderStateDestBlend(Value) value: Const D3DBLEND_ZERO = 1 (Default) Const D3DBLEND_ONE = 2 Const D3DBLEND_SRCCOLOR = 3 Const D3DBLEND_INVSRCCOLOR = 4 Const D3DBLEND_SRCALPHA = 5 Const D3DBLEND_INVSRCALPHA = 6 Const D3DBLEND_DESTALPHA = 7 Const D3DBLEND_INVDESTALPHA = 8 Const D3DBLEND_DESTCOLOR = 9 Const D3DBLEND_INVDESTCOLOR = 10 Const D3DBLEND_SRCALPHASAT = 11 Const D3DBLEND_BOTHSRCALPHA = 12 Const D3DBLEND_BOTHINVSRCALPHA = 13 Const D3DBLEND_FORCE_DWORD = $7FFFFFFF This will set the blend mode for just the Destination and NOT for particles. But, you can still acheive some neat effects. (I forget if you have to put this statement after the graphics.clear and before the graphics.display or not, try and let us know).
|
|
|
Post by u9 on Nov 1, 2006 16:21:18 GMT -5
Hey,
I just tried out graphics.SetRenderStateDestBlend but it seems that after I have set the rendering back to default with
graphics.SetRenderStateDestBlend D3DBLEND_ZERO all the images rendered after that are rendered without a transparent color. It seems to get back to normal after either graphics.clear or graphics.display. I'm not sure about which one makes it normal again.
Can you confirm this behavior? Can you make it so that I can render what I can render some normal images, then some special effects using some blending option, then render some more normal images.
So that something like this works even if I have some transparent color in myImage:
graphics.clear graphics.setImage myImage graphics.SetRenderStateDestBlend D3DBLEND_ONE graphics.setImage myEffectImage ' some special effects graphics.SetRenderStateDestBlend D3DBLEND_ZERO ' Default blending graphics.setImage myOtherImage graphics.display
|
|
|
Post by Guilect on Nov 2, 2006 9:09:51 GMT -5
I have removed the super secret command. It only allowed you set the destination blend mode. I have added a new command: graphics.SetBlend Src, Dest This allows you set both the source and destination blend modes. This optional command allows you to change (if so desired) the default methods that Brutus2D using for drawing and combining images. The allowable input values are the same for both Source and Destination, see values in a post above. This command allows you to mix and match drawing images normally and abnormally then back again. graphics.clear 255 graphics.SetBlend 4,4 graphics.SetImage myImage graphics.SetBlend 5,6 graphics.SetImage myImage2 graphics.display It seems that "graphics.SetBlend 5,6" returns things to normal. I am new at this and maybe I will learn more about as time goes on. Or perhaps you will learn something about this and teach us. This new command will be in the next release.
|
|