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 / I think I must be doing something wrong (EVOLVED Advanced Lighting) :(

Author
Message
SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 19th Aug 2013 03:13
Hey,
So after playing around with the Advanced Lighting examples and starting to kid myself I actually understand how it works, I started a project with AL, just something small to see if I could get it to work.
I thought I'd start off with a road, and see if I could get that working. That's where I'm stuck :/
Here's my code so far:


Here are the images I'm using
road.jpg:


road_Normal.jpg:


road_disp.png: (As you can see from the code, I tried not using this one)


Basically, the problem I'm having is I'm not getting any depth at all on the road :/
It just looks like an ordinary DBPro object, there's no visible parallax mapping on it.
Any ideas on what's wrong?
Thanks
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 19th Aug 2013 03:30
I think you forgot to uncomment this line: rem texture object 1, 2, 3

I am guessing this particular shader has no effect without the heightmap image applied also.

If I am only partially correct, I suppose the normal map's tarmac area isn't very bumpy; only the paint marks reveal any detectable form.

And I do not know if this can work without a light source given to the shader from the DBP program.

I know absolute jack about Evolved's Advanced Lighting to be honest. Perhaps someone else might know what is wrong.

One minor tip about height-mapping roads; make sure the lines are brighter in the greyscale range than the road itself. At the moment, the edges of the lines are darker; which is not realistic; the paint sits above the road, it is not carved into it. But this might not be noticeable in AL; it is just my gut feeling from having created loads of road textures myself.

SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 19th Aug 2013 04:34
Thanks for the reply Chris
The 'texture object 1, 2, 3' line is just something I was playing around with. I think you use the second texture stage to apply Specular mapping, not Displacement/Height mapping anyway... I tried leaving it out in some of the examples, and the parallax shader still works without it.
I tried applying some of the textures that come with Advanced Lighting examples to texture the road, without changing any other part of the program, like these images:

brick wall:


brick wall_n:


It seems to work perfectly with those :/
I did try making the road normal map more intense, I put the depth setting up to maximum, but still no luck :/
Thanks for the tip about road design by the way
I'll try working on this one again tomorrow... Maybe the road images are too big, or not the right dimensions... Not sure :/
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 19th Aug 2013 05:45
Quote: " I think you use the second texture stage to apply Specular mapping, not Displacement/Height mapping anyway...
"


Oh, ok then my tip is not all that good then; perhaps a little less light shining on the edges of the paint would produce a little shadowing effect which might look alright; thought it was a height map.

However if the second stage is the specular map; then Image 2 should be also, but it has been set as the normal map; which is causing the road to become flat due to there not being any colour to calculate from.

Check the shader file to see what texture sampler is declared second; or maybe a AL expert might know what is causing the flatness if I am wrong.

SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 3rd Sep 2013 03:20
Hey, sorry for being slow getting back on this one!
Ok, so, this one turned out to be really confusing, but got it figured in the end
The Parallax Occlusion shader needs to be fed a normal map image with transparency... Unless some of the normal map is transparent, it just produces a flat surface! Doesn't seem to be true of the other AL shaders so far, so I guess it's just a quirk of that one
Thanks for all the advice though

Login to post a reply

Server time is: 2026-07-07 00:08:14
Your offset time is: 2026-07-07 00:08:14