|
Unidirectional gouraud shading in the engine
#53137
08/23/05 15:24
08/23/05 15:24
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
OP
Senior Expert
|
OP
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
In MED and WED, when you move the camera around (panning), the lighting changes. I'd like to have this same thing in the engine except not changing from panning (be constant). Like, for example, if I had the Sun to the southeast 45° above the horizon, the lighting would be like that. This would cause the northwest sides of objects to be the darkest and the southeast sides to be the lightest. The lightest should be the true color version while the darkest be half transparent black. The function only needs to run once for the associated world and change when the world changes (such as going from the city world to the mountain world) being processed only once again (although things will be flagged as visible and invisible and eventually be created when the player changes the graphics options for some worlds).
These are MDL models, not blocks. I'd like to know how to accomplish this. The only thing that I can think of is to have a separate model for the lighting, but this is hard to do on curved surfaces like hilly land and could seriously hurt the frame rate, even with my.dynamic set to off.
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
Re: Unidirectional gouraud shading in the engine
[Re: ulillillia]
#53138
08/23/05 18:06
08/23/05 18:06
|
Joined: Aug 2002
Posts: 44 Panama City, FL
Specterdragon
Newbie
|
Newbie
Joined: Aug 2002
Posts: 44
Panama City, FL
|
Well, this could easily be accomplished with a simple shader. My question though... Isn't there a way to do this directly from inside WED? If it's somehting that simple, I would think there is a mat_shaded option on the object properties window.
Unfortunatly, I'm at work at the moment and can't look, but it seems like it would be that simple.
Just thinking out loud,
Specterdragon
|
|
|
Re: Unidirectional gouraud shading in the engine
[Re: ello]
#53140
08/23/05 18:33
08/23/05 18:33
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
OP
Senior Expert
|
OP
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
Hmm. I downloaded it and Winzip says that that ZIP file is an invalid archive and don't see anything. Thus, I can't use it. Winzip said to try to redownload it so I did and that didn't work either.
Question, does this allow you to configure the angle positions of the "Sun"?
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
Re: Unidirectional gouraud shading in the engine
[Re: ello]
#53142
08/23/05 18:49
08/23/05 18:49
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
OP
Senior Expert
|
OP
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
It's hard to see the lighting as the area is very foggy and from the best I can tell, I can't make anything out well enough to see if it's what I'm after. Perhaps showing an "octagonal" sphere might help (without the intense fog of course) with this applied. Interesting project though.
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
Re: Unidirectional gouraud shading in the engine
[Re: ulillillia]
#53143
08/29/05 08:53
08/29/05 08:53
|
Joined: Nov 2003
Posts: 677 There
Julius
Developer
|
Developer
Joined: Nov 2003
Posts: 677
There
|
i don't know if this will help, but try the settings in WED's Map Properties -> Sun to set the position and brightness of the sun, and in the manual (Help -> Contents) do a Seartch for "sun_light".
i hope this is what you're looking for. i think it lights all entities in the direction of the sun and puts shadow on the other side.
julius
flabadabadab.
|
|
|
Re: Unidirectional gouraud shading in the engine
[Re: Julius]
#53144
08/29/05 19:05
08/29/05 19:05
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
OP
Senior Expert
|
OP
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
I looked into that earlier, but it causes false coloring. I'd like it to have hard gouraud shading where all faces facing in one direction have the same lighting conditions. In fact, it turns my much-better-looking world: into this horrible-looking version of almost the same position (without any modifications besides the addition of the sun through script)): Before, the ambient was giving me problems, but setting it to zero fixed it. In this case, the ambient is zero and it doesn't help. In fact, both the ambient and albedo are at the default and simply changing them won't get what I want. That is definitely not acceptable. That's why I can't use the sun (or any lights at that). Perhaps you might want a screenshot or two of what I'm talking about to better explain this?
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
Re: Unidirectional gouraud shading in the engine
[Re: Pappenheimer]
#53146
08/29/05 22:33
08/29/05 22:33
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
OP
Senior Expert
|
OP
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
Perhaps, you might need some objects to help understand what I'm after? Here's a screenshot of what I'm talking about: This is a view of what I'm after. This is textured, by the way, and it took two hours to figure it out and it's still not perfect. If you want, you can download the model and see for yourself what I'm after. It's not exact, but fairly close In my case, the sun comes from due east and is 45 degrees above the horizon. If I were to have separate planes, the vertex count would practically double (or quadruple in some cases). This would seriously harm the frame rate. Blocks appear correctly with the shading as they should. Blocks have what I call "hard gouraud shading". If you add the sun and have a bunch of blocks of all shapes and look at them after building, that's exactly what I want for models. The screenshot directly above is how blocks appear. The darkest side should be half as bright as the lightest side. I don't think I'm asking much.
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
|