AShadow and SpriteCandy doesn't work together?

Blitz3D Forums/Blitz3D Userlibs/AShadow and SpriteCandy doesn't work together?

Jokkeri(Posted 2007) [#1]
I bought the AShadow library few days ago. The AShadow and the SpriteCandy libs works fine by themselves. If I use the SpriteCandy with the AShadow, all SpriteCandy objects seems to be under the AShadow effects.

Has anyone seen the same problem?


stayne(Posted 2007) [#2]
Is HUD_Update before or after PostProcess_Render?


Jokkeri(Posted 2007) [#3]
"Render" code looks like below:

ARenderWorld(cam)
AUpdateWater(cam)
UpdateRefract(cam)
PostProcess_Render(cam)
HUD_Update()
Flip 0

HUD_Update was also before PostProcess_Render, but I didn't see any difference.


Jokkeri(Posted 2007) [#4]
Problem is solved. I created a little function which return SpriteCandy object's pivot.

I use that function like this:
RenderEntity(HUD_JPA_ReturnObject(HUD_Main), Cam)

And return object function looks like this:
Function HUD_JPA_ReturnObject%(HUD_ID%)
Local HUDObj.SC_HUD = Object.SC_HUD(HUD_ID)
Return HUDObj\Piv
End Function

If somebody have better solution for this, let me know.

PS: Merry Christmas and Happy New Year 2008


_33(Posted 2007) [#5]
I think you have found the best solution from within AShadow. Good luck!


Pinete(Posted 2007) [#6]
Hi!,
Could you please share your entire solution?
I'm very interested too viewing how you've done it.

All the best!,


Jokkeri(Posted 2007) [#7]
Create function (I put this function to SpriteCandy.bb):
Function HUD_JPA_ReturnHUD%(HUD_ID%)
Local HUDObj.SC_HUD = Object.SC_HUD(HUD_ID)
Return HUDObj\Piv
End Function

Do basic stuffs (cams, huds, lights etc.)

Render all things in this order:
ARenderWorld(Cam)
AUpdateWater (Cam)
UpdateRefract Cam
HUD_Update()
PostProcess_Render Cam

;Render all SpriteCandy stuff from here
RenderEntity(HUD_JPA_ReturnHUD(HUD_Main), Cam)

Flip 0


Hope this helps!


Pinete(Posted 2007) [#8]
Thanks a lot!!! very helpful!..
:o)

Best regards!


SabataRH(Posted 2008) [#9]
Anyone able to get Ashadow working with vista? It's rendering no shadows on Nvidia 8800. I bought this system and would like use it but not if some of my target audience wont be able to see it.


Pinete(Posted 2008) [#10]
I can check it this afternoon...
I'll let you know.... ;)

All the best,


SabataRH(Posted 2008) [#11]
Any luck?


Pinete(Posted 2008) [#12]
sorry swapdonkey, yesterday was a very busy day..
I hope to have time today for make the test!


Jokkeri(Posted 2008) [#13]
I have GeForce 8800 GTS and me neither can't get shadows on the screen with Windows Vista and AShadow. AShadow contains a bug in the shadow system. I think that this is some kind of issue in the shaders. I use Swift Shadow System to produce shadows. Has anyone tried to use the AShadow with the Vista and some other graphics card (ATI Radeon Series, NVIDIA 8600 series or something else)?


Dreamora(Posted 2008) [#14]
It does not contain a bug but it uses a hack to do what it does and Vista works differently ("more secure") ... especially does it handle DX7 totally different.

Swifts Shadow System on the other end does not use any hardware at all. Its pure math, so it will always work unless your CPU / RAM is dying and more and more calculation errors appear.


stayne(Posted 2008) [#15]
I'm having this same problem with Particle Candy. I've tried everything. Anyone get these two working together?


_33(Posted 2008) [#16]
The problem with AShadow that I find which is the most irritating is the lack of structure in the code, lack of documentation, and other various lacks. The best option I found was to completely restructure the inner workings and make it all work with Types, remove all those misc global vars with random names. That way, it gets much easier to integrate AShadow to any project, cleans up the code in a general manner, helps you learn the package, etc etc... Yet, you have to spend some time working this 200kb source file to get to that point, but very feasible (search / replace).

ie. annoying globals:
Glow_CopyTexMethod=1
Ref_Glow_DarkPower=4
Ref_Glow_BlurPower=4
Ref_CountBISpr# = 6.0
Ref_BlSprAlpha#= 0.20
CreateGlow camera, 1024, 768 ,0.5,0.5
Glow_Blend = 1
Ref_Glow_ON = 1

Usually, I like to know who owns these... I prefer stuff like:
AShadow\Glow_CopyTexMethod=1
AShadow\Ref_Glow_DarkPower=4
AShadow\Ref_Glow_BlurPower=4
AShadow\Ref_CountBISpr# = 6.0
AShadow\Ref_BlSprAlpha#= 0.20
CreateGlow camera, 1024, 768 ,0.5,0.5
AShadow\Glow_Blend = 1
AShadow\Ref_Glow_ON = 1