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 / Advanced Lighting - How to add transparent / ghosted objects

Author
Message
Dimis
13
Years of Service
User Offline
Joined: 12th Jun 2011
Location: Athens, Hellas
Posted: 5th Feb 2015 07:20
I recently started to work with the latest Evolved's Advanced Lighting system. It is a great lighting system, but the absence of documentation is a problem.
I have been able to install it in my game, but i don't know how to add transparent or ghosted objects in the lighting system. Ghosted objects simply disappear, i suppose i have to use a shader, there is a folder named "transparent" with shaders, but i don't know how to use them, my attempts have failed. Does anyone know how to handle transparencies or ghosted objects with Advanced Lighting?
With the earlier AL, all i needed to do, was not to include the transparent objects to the AL system. Now that does not work correctly because those objects are rendered in front of every other object (enable/disable object zwrite will not help).
Any help will be very appreciated.

Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 5th Feb 2015 21:57
The palm tree demo gives examples of many of the transparent shaders, simple objects work well but there are issues when a transparent object layers over itself, like hair wrapping around a head

Dimis
13
Years of Service
User Offline
Joined: 12th Jun 2011
Location: Athens, Hellas
Posted: 5th Feb 2015 22:06
Thanks Ortu, i suppose all the native DBpro commands will not work, i can have transparency only with shaders in AL.

Well generally there are problems when using many transparencies in DBpro, the hair problem you mentioned is common from my experience.

Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 6th Feb 2015 02:56
yeah, in AL everything needs to be rendered via shader

Dimis
13
Years of Service
User Offline
Joined: 12th Jun 2011
Location: Athens, Hellas
Posted: 6th Feb 2015 07:22
Ok, transparencies are showing up now. Another thing that i don't know how to make it work, is how to make an object from 100% visible to fade away. Something like the "set alpha mapping on" command to gradually change the opacity of the object. My particle system works in AL but the particles don't fade gradually, they just disappear.

Kuper
17
Years of Service
User Offline
Joined: 25th Feb 2008
Playing: Planescape:Torment
Posted: 6th Feb 2015 10:57
Quote: "Thanks Ortu, i suppose all the native DBpro commands will not work, i can have transparency only with shaders in AL"

Advanced lighting also use dbpro commands such as set object transparency and ghost object on for additive blending. To make object fade away you can just add multiply factor at the end of shader.

Dimis
13
Years of Service
User Offline
Joined: 12th Jun 2011
Location: Athens, Hellas
Posted: 6th Feb 2015 11:49
Thanks for the reply Kuper, but isn't there a more direct way to change the opacity of an object in advanced lighting? I don't know how to work with shader code.

Kuper
17
Years of Service
User Offline
Joined: 25th Feb 2008
Playing: Planescape:Torment
Posted: 6th Feb 2015 19:27
@Dimis
If you want to make object fade you can make it from DBPro
ghost object on 1
fade object 1,fadevalue#

wilindron
12
Years of Service
User Offline
Joined: 2nd Aug 2012
Location: carmona /spain
Posted: 11th Feb 2015 18:23
you can try loading the object out of the calculation of advanced lighning (lighting, shadows, normal ...). Loads the object as a standard of darkbasic object, will you apply ghost object, transparency, etc ... After you assign the mask camera to render out in the end. In the version of evolved's advanced lightning that use the camera mask is 15, only calculated the post shaders ... try this method, it is ideal for fire, fog, smoke, glass, computer screens, bullets, etc ... but will not affect the light's advance ligtning evolved.

hope you serve this method ...

if you want to do directly from the shaders, you must modify shaders, rendering methods (treatment of alpha channel, etc,,,), calculation of transparency, etc ...

sorry for my English, I am using a web translator
Dimis
13
Years of Service
User Offline
Joined: 12th Jun 2011
Location: Athens, Hellas
Posted: 12th Feb 2015 09:24
Kuper, wilindron
Thank you guys for the replies. I think it is time for me to start learning how to work with shaders, seems like it is the best way to make my effects.

wilindron
12
Years of Service
User Offline
Joined: 2nd Aug 2012
Location: carmona /spain
Posted: 12th Feb 2015 22:53
hey Dimis ...
I recommend you look at the demos evolved and identify which texture channel is applying transparency. Usually the alpha channel of the diffuse texture (in the version I use, now may be different). In my version, you must modify the shader because transparency is hard (no transparency to 50% or is transparent or opaque). You can do this by changing the shader, changing the way that renders the transparency channel. There is much documentation on the web, and manuals hlsl (s change only some numerical code of some generic variables, really like is easy).
Then you prepare the texture of your model, with opaque white, black is transparent and gray rgb (128,128,128) transparency to 50%.
Then do the appropriate tests to see if the model behaves correctly as rendering in advanced lightning is calculated by (diffuse, normal, lighting, etc) layers and then added in the last render.

It's a little complicated at first, but really as easy and no need advanced knowledge of programming ...

I hope you serve ... if we have a question here, ok?

sorry for my English, I am using a web translator.

Login to post a reply

Server time is: 2025-05-12 12:39:37
Your offset time is: 2025-05-12 12:39:37