Gradient Shading

Everything related to 3D programming
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Gradient Shading

Post by Samuel »

Looks pretty close to what you need. It's not a compositor though just a shader.
Meaning it's per material and it won't effect the entire world.

EDIT:
After looking through that link a bit more. I'm not sure if it's what your looking for.
That shader works off of the mesh vertices. Left side of the mesh having black and
right side having white. It will make your terrain look flat from above views.

Does the shader need to take into account light and camera positions?
This one doesn't because it's more of a coloring effect then a lighting effect.
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Gradient Shading

Post by Samuel »

Alexi wrote:Could this be bundled as compositor? So we could handle all situations at ones like the far distanced turning into solid (already by fog i think) and the Camera view to obtain the 2D Vector look.
I don't have an extensive knowledge on compositors. So, I can't say for sure. If no one on the PB forums here has an answer maybe it's worth a try
asking on the OGRE forums.

Alexi wrote: A material script would require to do the runtime (long after Add3DArchive is done, unregistered files) material generation, which isn't really possible with PB yet
Might not help much, but take a look at ReloadMaterial.pb.
http://purebasic.developpez.com/documen ... al.pb.html

You'll see that creating a script in runtime (even after Add3DArchive()) is very possible and relatively easy to do.
Using that same sample as reference I made a material script editor that creates scripts in runtime and then displays the scripts
on entities right then and there. All this is done after the Add3DArchive()'s are set and parsed.
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Gradient Shading

Post by Samuel »

Alexi wrote: In my case the script doesn't notice the new Texture name, or maybe the Textures can't be added at runtime. :? (parameters and other values work)
That's strange it seems to work fine for me. Anyways good luck with the compositor.
Post Reply