Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, 1 invisible), 584 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
terrain_chunk bottom-right triangle lighting problem #358385
02/10/11 23:13
02/10/11 23:13
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Has anyone else ran into this problem, where the bottom-right triangle in each terrain_chunk has it's lighting more extreme then the rest of the vertices?





In this example the terrain_chunk = 8, so I could get more into the view. Usually it would be like 32.
Anyway, make terrain_chunk = 16, there would be 1/2 less of these extreme lit triangles, etc.

Our level terrain is 256 x 256 vertices, so we cannot have terrain_chunk = 0, don't want it at 0 anyhow.

terrain_lod = 1, although have tested at 0.

The sun_angle effects how noticeable this chunk edge triangle is (almost unnoticeable at times), but it can still be seen and our sun is dynamic,
so just setting the sun to a position that makes it less noticeable is not an option.

I have tried different WED build parameters, but it always still seems to be there.

If anyone has ran into this problem or has any ideas on how to solve it, I would appreciate the help.

Thanks,
Loco


Professional A8.30
Spoils of War - East Coast Games
Re: terrain_chunk bottom-right triangle lighting problem [Re: Locoweed] #358403
02/11/11 01:09
02/11/11 01:09
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
The game looks pretty neat!

Quote:
Our level terrain is 256 x 256 vertices

I think that's an invalid size for chunked terrain, 257x257 should be the correct size (see manual). I do not know if that fixes your lighting problem, though.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: terrain_chunk bottom-right triangle lighting problem [Re: Superku] #358406
02/11/11 01:15
02/11/11 01:15
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
I will check that out, will take like 5 seconds.

Thanks.


Professional A8.30
Spoils of War - East Coast Games
Re: terrain_chunk bottom-right triangle lighting problem [Re: Locoweed] #358407
02/11/11 01:23
02/11/11 01:23
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
That didn't fix it.

In the manual under terrain_chunk it says this:

For avoiding unchunked mesh stripes, terrain_chunk should be a multiple of 8, and the number of terrain mesh squares in x and y direction should be a multiple of the terrain_chunk value.

Anyway, wish that would have worked. Might still be something like that, but 257x257 terrain didn't work.

To me it almost seems like the last vertex of the terrain chunk isn't being passed into the vertex shader part of the terrain shader. Which sounds simlar to what you suggested, but unfortunately that didn't work.

Thanks,
Loco


Professional A8.30
Spoils of War - East Coast Games
Re: terrain_chunk bottom-right triangle lighting problem [Re: Locoweed] #358408
02/11/11 01:37
02/11/11 01:37
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
and the number of terrain mesh squares in x and y direction should be a multiple of the terrain_chunk value.

Yes, 16 terrain meshes consist out of 17 vertices.

Which terrain shader are you using?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: terrain_chunk bottom-right triangle lighting problem [Re: Superku] #358409
02/11/11 01:40
02/11/11 01:40
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
It is a special written terrain shader, which could be the problem. If you are good at shaders I can send it to you. It also calls atmospheric scattering and stuff, but maybe you could see the problem quickly.

Let me know if you good with shaders and I can send you a link to the .fx file.

It's pretty complex and calls a dll for atmospheric scattering. Unfortunately the guy who wrote it got in fight with bossman and quit. So if it isn't a problem anyone alse has seen before, it's probably the shader code. I have been playing around with that also but haven't found a solutions in there either with what I have done.

It just seems like the last vertex of the terrain_chunk isn't being recogninized or something screwy with it in the vertex shader to me.

Thanks,
Loco


Professional A8.30
Spoils of War - East Coast Games
Re: terrain_chunk bottom-right triangle lighting problem [Re: Locoweed] #358410
02/11/11 01:46
02/11/11 01:46
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
It looks like a wrong vertex normal.
The problem is, there was a bug in ent_getvertex so you cannot check the normal currently. (bug was fixed in 8.11)

I'm mediocre at shader programming, I did not write a terrain shader or a shader with dynamic lights, yet, but I can have a look at it.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: terrain_chunk bottom-right triangle lighting problem [Re: Superku] #358412
02/11/11 01:52
02/11/11 01:52
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
I will send to you in PM. It also uses mipmaps for level of detail depending on how close cam to the vertex and stuff. I will send in PM and see if any thing sticks out to you.


Professional A8.30
Spoils of War - East Coast Games
Re: terrain_chunk bottom-right triangle lighting problem [Re: Superku] #358416
02/11/11 02:44
02/11/11 02:44
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Hey Superku,

I took out all the atmospheric scattering code in the shader and still have the lit edge triangles.

After looking at changes, I think we need to tone down on the atmospheric scattering some though.



Anyway, it wasn't the atmospheric scattering code, so can cross that off.

I know it's something simple and stupid, been trying to figure it for 2 days now and it is frying my brain.

Thanks for help,
Loco


Professional A8.30
Spoils of War - East Coast Games
Re: terrain_chunk bottom-right triangle lighting problem [Re: Locoweed] #358417
02/11/11 03:08
02/11/11 03:08
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Thanks for help Superku, atleast I know what area the problem is now.

I owe you one.

Later,
Loco


Professional A8.30
Spoils of War - East Coast Games

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1