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 effects

Author
Message
Cescano
3
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 8th Nov 2015 22:05
I can't find any usefull tweak values in the AL shaders, normal evolved shaders has something like "AmbientLight", but I can't find it in the AL shaders.
Cescano
3
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 8th Nov 2015 22:14
In particular I have an object that I lock on the screen, and keep rotating endless. The problem is that I want it full diffuse and not be affected by other shadows, or having the part opposite to the light source too dark, I want it to be all with the same light level.
Cescano
3
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 10th Nov 2015 18:36
Nobody knows? Even using the normalmap shader (not the AL one) it gives White borders, so I must use the AL ones, I have tried everything, mask options, etc, but I can't find a decend way to have a rotating object locked on the screen, for example to sign which of the 2 players is active
WickedX
9
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Nov 2015 19:06 Edited at: 10th Nov 2015 19:10
I admit, I am not familiar at all with AL. On every system I have ran the demo's on, the frame rate sucks. So, I don't know if this will help. Maybe you can utilize Cloggy`s Hud positioning function instead of Lock Object. You will need to offset the objects angle by the cameras angle of course.

https://forum.thegamecreators.com/thread/42508
Ortu
DBPro Master
10
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 10th Nov 2015 20:36
I believe that the green channel in the specular map can get the light effect you want. AL treats values of 0 and 255 specially in this channel/map.

He had a listing of maps, channels, and how various AL shaders used them, but it seems his forums are down
Cescano
3
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 10th Nov 2015 20:42
This will just change the brightness on the Whole object, I need to have this object with the same brightness on all sides, for example the part exposed to the sun with the same light as the backside which get no light
Ortu
DBPro Master
10
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 11th Nov 2015 02:06
Yes I know, but there is a channel in one of the maps (I think green in specular on at least the normalmap_clip.fx shader) in which a value of 0 or 255 across the entire channel (dont remember which) acts as a flag to the shader to render the object with flat constant lighting ignoring all light sources and shadows.

I'll do some testing to see if I can reproduce it.
Ortu
DBPro Master
10
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 11th Nov 2015 04:18 Edited at: 11th Nov 2015 04:25
ok, testing reproduced this. It forces a render of flat diffuse ignoring all light and shadow on all directions:

Attachments

Login to view attachments
Cescano
3
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 11th Nov 2015 10:50
Just 1point of difference make this? Also I wonder if the other side looks the same as the object I have keeps rotating on the screen.
The green value is changed on the specular texture so on the stage 2 right?
Ortu
DBPro Master
10
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 11th Nov 2015 19:55
Normally it won't have that effect, any value between 0 and 254 will control the specular hardness (gloss/spread) while the red channel controls specular power (brightness/intensity)

But in AL, a value of 255 in this specific channel+map acts as a special flag telling AL to render the object differently, as just the flat diffuse.

Yes it is the rgba green component channel of the image assigned to stage 2, and it looks like that from all sides ignoring any light or shadow sources.

Login to post a reply

Server time is: 2018-08-15 06:22:26
Your offset time is: 2018-08-15 06:22:26