AShadow Lib : Refractive Water Question
Blitz3D Forums/Blitz3D Programming/AShadow Lib : Refractive Water Question
| ||
Hello, Is it possible to remove some meshes/sprites from showing on the water's refraction ? |
| ||
Only if you can code the D3D clipping to do that. Or maybe I didn't understand your question. I use AShadow with reflective/refractive/fog water. |
| ||
ok, i have another problem, my GUI in game is build with sprites, if I turn on Glow or blur or DOF, the effects will also work on the GUI.... I really need to find a solution to exclude certain things from being process by the shaders, but how ? :/ Any help is welcome! |
| ||
Those are PostProcess effects (Glow, blur, DOF). If you do your POst Process, and THEN your GUI, you shouldn't have any problems. I use FastImage, which, I think, shouldn't have issues with AShadow. Also, if you can set your own RenderStates, then you could probably remove the effects yourself with the proper settings. Here. I won't show you how this works. But, you'll be able to understand what Ashadow does with these RenderState codes. This is my func_d3d.bb that I use in conjunction with my own version of Ashadow.bb, that uses these constants. I changed all the numbers with these so I can figure out what is going on in this complex set of tools. I suggest you do the same. Cheers. |
| ||
after PostProcess render, simply use RenderEntity(MySprite) and it will not be affected by bloom, DOF or any other postproces VFX |
| ||
yeah, but the problem of doing that appears when you are working with other libraries as spritecandy or similars... You cannot do 'renderentity(entity)' because that part is done by the own function of the lib... I've worked with FastImage and it works fine. I start to work with fastfimage for this issue... Regards! |
| ||
..yup..thats truth if you are not using parent as a render entity...if you create pivot and make it parent for whole gui elements, and then using Rendernetity(CreatedParentPivot) then its will do work just fine...I tried that with Alpha GUI and its working just fine...I didnt try SpriteCandy but it should be same I think...as for FastImage, I find that its not working well on ATI cards(all sprites shown at the same time, regardless are they hidden or shown).. |
| ||
Thanks everyone! But I don't think I am understanding, I spent 2 hours reading the Ashadow.bb but I just can't get anywhere. Here a simple code, trying to use 'renderentity()' but, looks like i am missing something? Include "AShadowBBinclude/Ashadow.bb" Graphics3D 800,600,16,2 SetBuffer BackBuffer() cam=CreateCamera() Ref_Glow_DarkPower=5 Ref_Glow_BlurPower=3 Ref_BlSprAlpha#=.22 CreateGlow cam, 180, 135 ,.4,.8 Ref_Glow_ON=0 CreateBlur cam,.0 CreateDOF ( cam, 4, 15, 1, 3, 0.35) Ref_DOF=0 Pivottest = CreatePivot() Spritetest = CreateSprite(Pivottest) ; ACreateSprite(Pivottest) PositionEntity Pivottest,0,0,10 Pivottest2 = CreatePivot() Spritetest2 = CreateSprite(Pivottest2) EntityColor Spritetest2,255,0,0 PositionEntity Pivottest2,-1,0,15 Pivottest3 = CreatePivot() Spritetest3 = CreateSprite(Pivottest3) EntityColor Spritetest3,0,255,0 PositionEntity Pivottest3,-2,0,17 While Not KeyHit(1) KeyControl(cam,.01) mouselook(cam) If KeyHit(29) Ref_Glow_ON=1-Ref_Glow_ON If KeyHit(33) Ref_DOF = 1 - Ref_DOF RenderWorld() PostProcess_Render cam RenderEntity( Pivottest, cam) Text 5,105,"Press ''Ctrl'' for Glow-effect: "+Ref_Glow_ON Text 5,125,"Press ''F'' for DOF: "+Ref_DOF Flip Wend End Function mouselook(ent) mxspd#=MouseXSpeed()*0.25 myspd#=MouseYSpeed()*0.25 MoveMouse GraphicsWidth()/2,GraphicsHeight()/2 campitch#=EntityPitch(ent)+myspd# If campitch#<-85 Then campitch#=-85 If campitch#>85 Then campitch#=85 RotateEntity ent,campitch#,EntityYaw(ent)-mxspd#,EntityRoll(ent) End Function Function KeyControl(ent,mov#=1) If KeyDown(200) MoveEntity ent,0,0,mov If KeyDown(208) MoveEntity ent,0,0,-mov If KeyDown(205) MoveEntity ent,mov,0,0 If KeyDown(203) MoveEntity ent,-mov,0,0 If KeyDown(17) MoveEntity ent,0,0,mov If KeyDown(31) MoveEntity ent,0,0,-mov If KeyDown(32) MoveEntity ent,mov,0,0 If KeyDown(30) MoveEntity ent,-mov,0,0 If MouseDown(1) MoveEntity ent,0,0,mov If MouseDown(2) MoveEntity ent,0,0,-mov End Function |
| ||
Up Up ^^ please help ^^ |
| ||
..I'll email you working example with media when I get back home.. |
| ||
Sprite Candy uses a single surface system so simply do renderentity with that one used for the UI shouldn't be too hard to find it in the sources :) |
| ||
Graphics3d 1024,768,32,1 Camera=createcamera() ;loadstuff blah blah ;load one sprite and same rule apply to parent lo=LoadTexture("lo.tga",2) Global logo=CreateSprite(camera) EntityTexture logo,lo MoveEntity Logo,7,-5.5,8 PositionEntity logo,0,0,4,False EntityOrder Logo,-1 ;main loop While Not KeyDown(1) ;your game loop stuff here blah blah UpdateWorld RenderWorld ;Ashadow stuff here AUpdateWater (camera) UpdateRefract camera PostProcess_Render camera ;and now postprocessing stuff you want to be rendered over everything RenderEntity (Logo,camera,0,0) Flip False Wend end Thats it..this settings working just fine if you put parent of all HUD/GUI elements in to RenderEntity.. Settings you see here regarding Logo is for given resolution since I use to put it manually on proper position, so, suit yourself for some other screen size...I hope it helps..this working just fine here and none of my sprites or HUD is affected by Ashadow postprocessing /refracting if came over water, DOF, Bloom, etc/ |
| ||
thank you, but still it isn't working here ??? Please can you test that code on your computer, if you push L CTRL or F it will add some effects and it shouldn't right? what the hell !!!!!!!!! :) Include "AShadowBBinclude/Ashadow.bb" Graphics3D 1024,768,32,2 ;loadstuff blah blah Camera=CreateCamera() Ref_Glow_DarkPower=5 Ref_Glow_BlurPower=3 Ref_BlSprAlpha#=.22 CreateGlow Camera, 180, 135 ,.4,.8 Ref_Glow_ON=0 CreateBlur Camera,.0 CreateDOF ( Camera, 4, 15, 1, 3, 0.35) Ref_DOF=0 ;load one sprite and same rule apply to parent ;lo=LoadTexture("wall_00.jpg",2) Global logo=CreateSprite(Camera) ;EntityTexture logo,lo MoveEntity Logo,7,-5.5,8 PositionEntity logo,0,0,4,False EntityOrder Logo,-1 ;main loop While Not KeyDown(1) ;your game loop stuff here blah blah If KeyHit(29) Ref_Glow_ON=1-Ref_Glow_ON ;L CTRL If KeyHit(33) Ref_DOF = 1 - Ref_DOF ;F UpdateWorld RenderWorld ;Ashadow stuff here AUpdateWater (Camera) UpdateRefract Camera PostProcess_Render Camera ;and now postprocessing stuff you want to be rendered over everything RenderEntity (Logo,Camera,0,0) Text 10,10,Ref_Glow_ON Text 10,20,Ref_DOF Flip False Wend End |
| ||
I'm in the ofice right now..I'll post it when i came back together with media I used and one compiled version.. |