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 / Evolved's Advanced Lighting and Terrain?

Author
Message
SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 14th Sep 2013 03:17
Hi,
Sorry, this is probably the 3rd or 4th question I've posted about Advanced Lighting, I'll figure it out in the end
Ok, so what I'm trying to figure out here is the best way to create terrain for an Advanced Lighting project? What I'm talking about here is terrain held as an ordinary 3d object, not Blitzterrain or Advanced Terrain (although if you think Advanced Lighting would handle those better, please say )
I tried creating a scene using 3D World Studio and loading it in, applying an effect, etc. It looks horrible... :/



So this led me to spend 4 days creating my own Terrain Editor in DBPro, which I've posted in Code Snippets. The downside of that is bland, one-texture terrain, which doesn't look amazingly professional... I thought I'd try it though, just to see if I could get some terrain working. So I finished my editor, made a quick terrain, and exported it as a .dbo
So this is the result... It looks... better... but I'd still count it as a waste of 4 days work



The main problem there is the horribly jagged edges of the shadows. I've played around with it for a while, and I can't seem to do anything about them. Also, when looking around the environment, shadows randomly flicker in and out on parts of the terrain, mostly parts where there shouldn't actually be any shadows
So does anyone have any ideas how to get some terrain with Advanced Lighting that doesn't look horrible in one way or another? xD
Thank you
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 14th Sep 2013 11:10
Doesn't AL have it's own terrain system (that is based on mesh rebuilding, the code is open source so you can change it as you see fit I guess)?

Anyway, the shadows probably fail because your terrain shader (if you have any at all?) doesn't do all the required techniques as it should, especially depth and light mapping I would guess.
Also to make a multi-textured mesh (like a terrain) you would need a shader for that too; search for blend shading / texture blending


"Why do programmers get Halloween and Christmas mixed up?"
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Sep 2013 13:07
Hi there. What I do, is make the shadows texture on the fly. Take a look to this example attached , where lights are off and shadows are made with just colour....you could try also using collor difuse with vertexdata where we can get good result.

Cheers.

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Sep 2013 14:21
@Chafari

Interesting. Haven't quite understood what the code is doing yet but result looks good (except for camera getting stuck now and then ).

Wasn't clear to me whether you were talking about shading (i.e. caused by light falling at an oblique angle on a surface) or shadows (i.e. caused by light being obstructed). Your demo looks like the former in which case it is really easy using built-in DBPro commands on Advanced Terrain.



Powered by Free Banners
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Sep 2013 14:37
@GG...you are right, the shadows has just one thirection in this example...we could raycast for a point light...but this one is working like if it was the sun....about the camera bump, that is because I' m forcing player to stop if the groung height is too hight...it was a collision system made on the fly also...how hard is writing with f smartphone...

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Sep 2013 22:47 Edited at: 14th Sep 2013 22:48
@Chafari

But why don't you use the built-in DBPro lighting commands on the terrain? See this post:

how to use DBPro lights with Advanced Terrain

If I recall correctly, that isn't a perfect solution because the normals are incorrectly calculated along the seams between limbs - but otherwise it should be OK.



Powered by Free Banners
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Sep 2013 23:12
@GG...That works pretty good..!!! thanks....I've got somewhere lost in any folder lots of good codes, but I nearly do not find my glasses in front of my nose... I will keep this...

I'm not a grumpy grandpa
SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 15th Sep 2013 02:45
Thanks for all the responses
I get the strong feeling I'm in shaderland here... Shaders scare me
I think it's because we all have an instinctive fear of the unknown xD
I'm pretty sure, looking through the commands, the latest version of AL doesn't have a built-in terrain system :/
Should probably say, I'm using the new version of AL, which from what I've read seems to have a reputation for being awesome, but because it's unfinished, maybe a little more buggy than Evolved's old system. This is getting sidetracked a bit, but I was going to ask, I don't suppose there's anywhere I could download his old system, is there please? I don't think he has a download for it on his website anymore, but it could be useful for tests, to see if a bug is my fault or a glitch in his new system
Anyway, I'm not sure if you can use other Shaders in Advanced Lighting, like a terrain shader (not actually sure what a terrain shader does )... I've tried with a few of them that work ordinarily, and things don't behave properly :/
Chafari, thanks for sharing your way of doing it, really interesting! Problem is, I think I'm right in saying that's not going to work for a dynamic scene, right? The sky and lighting in my scene is dynamic, so static shadows might not look right, sorry
Well, I'll keep playing around with it, and hopefully something will work. Thanks for the help, and if you've got any other ideas (or a link to the old AL), please let me know
Thanks!

Login to post a reply

Server time is: 2026-07-06 16:49:53
Your offset time is: 2026-07-06 16:49:53