Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / fading animated objects

Author
Message
Nabz_32x
17
Years of Service
User Offline
Joined: 25th Oct 2008
Location:
Posted: 14th Aug 2013 22:37
Hello, since I posted this accidently in the dark Basic Forums and no mod deleted, or moved my post as requested,

I thought it would be my turn to post this up again in the proper Forum.

My Problem is, for my Reggie game I wanted to Highlight enemys when the Player is above them, so the Player can see in advance if he is able to hit the enemy.

However I tried to use the FADE OBJECT command to brighten the enemy objects and it only seems to work on modells which aren´t animated (could also be untextured, because the object it works on is both ).

Is there a solution to this?

If not I will have to add a 3d plain showing up underneath the enemy when the Player is above the enemy.
I really like to use a changed brightness of the object for that, so can someone please tell me if it is possible to fade animated or textured objects ?

Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 16th Aug 2013 04:27 Edited at: 16th Aug 2013 04:33
That's strange. I don't know much about 3D modelling so I can't help with any problems your models may have, but you could try using set object ambient obj,0 and set object light obj,0 to brighten them. Those commands basically make the object ignore the effects of ambient and external lights on them, so they won't be darkened by anything.

Alternately you could write a shader to do it.

Hmm. It's been a while .
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 16th Aug 2013 08:10
Quote: "
Ghost Object
Set Object Transparency
Fade Object
"


Have you looked at these yet?

Nabz_32x
17
Years of Service
User Offline
Joined: 25th Oct 2008
Location:
Posted: 16th Aug 2013 12:53
Quote: "
[quote] Ghost Object
Set Object Transparency
Fade Object
"

Have you looked at these yet?
[/Quote]

Yes I use them a lot on my landscape, fade object allways works nice for DB Pro generated triangles.

[/quote]
set object ambient obj,0 and set object light obj,0
[Quote]

Thanks, this works to bright the models up. For making These darker however, i guess i Need a shader for that then.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Aug 2013 13:20
Yes, a shader gives you more control. But you could do something like the attached - just move the mouse over the object you want to highlight. You can try changing the highlighting colour in these lines:





Powered by Free Banners
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Aug 2013 13:38
This gives the previous demo a bit more control over the highlighting:



If you increase the color object value you can increase the effect of the main lights in the scene. It's up to you to find a suitable balance.



Powered by Free Banners
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 16th Aug 2013 17:30
I pulled this shader from Dark Shader, Just create a new text file and rename to HaloHighlight.fx or probably anything relevant to you...



Hope this helps... and also hope it is ok for me to post that code... if not let me know or a MOD can remove it...

Nabz_32x
17
Years of Service
User Offline
Joined: 25th Oct 2008
Location:
Posted: 18th Aug 2013 03:58 Edited at: 18th Aug 2013 04:01
Thx for all the Info guys

your Solution Gandalf is a nice Idea,
as I haven't Mastered the Art of texturing an x object
With a Single file like you did in your example yet,
I Will have to delete the object and clone it to Have it Textured again.

I will Look at the Halo effect shader tomorow,
This will be my First Time working with shaders.

I also have problems with object transparency /
Alpha mapping, as transparent objects won't Show
My selfmade polys which are behind them and solid,
Only disabling the z Buffer write for the transparent objects
seems to solve this.
however The transition while slowly fading the object
Transparent is a Bit akward then.
are there some object settings that could cause my
Polys to be hidden behind transparent objects?

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 18th Aug 2013 04:09
Have you looked at SET OBJECT NORMALS yet? I used it on my plant environment demo if you have seen it... It solved some lighting issues I had...

Nabz_32x
17
Years of Service
User Offline
Joined: 25th Oct 2008
Location:
Posted: 18th Aug 2013 16:54
The Set Object Normals command works fine to improve the highlighting effect thx.

As for the Transparency issues, using the set object transparency command works well without disabling the zwrite abillity of the object. However it only works on the plains I created, the single Polys will give some very random results still( tried all transparency flags through).

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 19th Aug 2013 13:15
Any luck with the shader?

Nabz_32x
17
Years of Service
User Offline
Joined: 25th Oct 2008
Location:
Posted: 20th Aug 2013 18:44 Edited at: 20th Aug 2013 21:44



This is how the shader Looks.
to make the Object effectless again I used the SET SHADING OFF command,
but it didn´t seem to affect the object at all.
Do I have to recreate the whole object again to get it back to normal?
Edit:
I have found the solution to this was to use SET OBJECT EFFECT Nr , 0 instead of SET SHADING OFF Nr

Is this effect meant to look like this? I Need to know this,
because my graphics Card is dying on me most of the time,
when using shaders.

Edit2:
The gray parts seem to be those parts of the object, which where simply coloured and not textured, I plan on using improved textures anyway, so there won´t be parts of objects which are just coloured anymore in the future.
So I think I will go with this shader for highlighting, is it okay to just use this or do I have to buy dark shader first?

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Aug 2013 22:24
Quote: "is it okay to just use this "


Yes.

Quote: "do I have to buy dark shader first"


No. Dark Shader is just for developing and testing shaders. If you're just using shaders other people have written then you don't need it.



Powered by Free Banners
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 20th Aug 2013 22:34
Sweet, I helped again

Login to post a reply

Server time is: 2026-07-07 01:53:39
Your offset time is: 2026-07-07 01:53:39