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 Toon Shader Issue

Author
Message
TheViking
13
Years of Service
User Offline
Joined: 16th Feb 2012
Location:
Posted: 21st Oct 2014 01:49
Hey All,

Just curious if anyone knows what's going on here or why I may be getting this issue with Evolved's Toon Shader. It seems that my one model works out perfectly using this, yet if I use the exact same code for another object I get a blank texture (even using the same texture), while the third situation is if I switch the order of the texture layers around, I get the texture, and the outline (though poorly) but there is no shading, the shadows seem to be kept in place. The forth situation is I can get the shading to work, and the outline to work, but there is no texture and the object is all shades of blue.

I have tried for days to figure out what's going on here and why it seems to work for only one object. I really like the appearance of this shader and would like to use it a little more, however if I can't figure it out, I may have to switch.

Oh, while here, does anyone know how I might be able to set up the shader for 2 or more light sources. (I'm not too good at shader language)

Any info or suggestions are much appreciated. Thanks,

Here's a pic of the issue: There are objects here each using a different method mentioned above to try to get it working. Simple Code below Pic...



And here is the code I'm using to Load it: (Sorry it's messy, haven't cared much while trying to figure this out -- Frustrated.



Thanks all for any help!
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Oct 2014 02:26
Why have you used different texture stages for the objects, i.e. stages 2, 3 and 1 in two cases, stages 2, 0 and 1 in the third case, and only stages 0 and 1 in the fourth?

Also, could you explain what's wrong in the image shown?



Powered by Free Banners
TheViking
13
Years of Service
User Offline
Joined: 16th Feb 2012
Location:
Posted: 22nd Oct 2014 03:59 Edited at: 22nd Oct 2014 07:47
Hey GG,

The different stages for each one is just to show what the outcome is. If I texture the object with the method used for object 1, the other ones appear blank, if I texture it using one of the other ones, it yields different results. I only had the different methods to try to figure out why some are textured and some are not.

The issue with the image is that they all should be textured, and have the same shading. However, the first object (main character) works perfect, the others either aren't textured or, aren't shaded... it seemed strange that if I textured an object the exact same way it would show up without any texture.

That all being said, I did just figure out the issue I think. Seems when I texture all of them with just 2 layers instead of the three (the main layer and the shade layer) - removed the edge layer, it looks like it works relatively well.

However, I still have not figured out how to alter the shader to accommodate for multiple lights... could come in handy for dark alleys and such... if anyone has any suggestions...?

thanks
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 22nd Oct 2014 12:17
Quote: "However, I still have not figured out how to alter the shader to accommodate for multiple lights... could come in handy for dark alleys and such... if anyone has any suggestions...?"

This is just generally speaking since I don't have much experience with Evolved's shaders, but you have to provide data about each of your light sources to your shader and then add their light effects together for each pixel (or vertex if you use that). In shader model 2 / 3 which is what you have to work with in DirectX 9 (as is used by DBPro) you can only have loops that are unrolled during compilation, that is you cannot have a dynamic number of lights without faking it using different shaders (or techniques) that have 1 light, 2 lights, 3 lights... and so on.

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Oct 2014 13:00
Quote: "However, the first object (main character) works perfect, the others either aren't textured or, aren't shaded... it seemed strange that if I textured an object the exact same way it would show up without any texture."


Since you haven't shown us the textures you expect to see it's very hard for us to see what's wrong. For example, your animal object looks as if it's the hyena.x model in your code - and the main texture seems to be metal.png for that object. But you haven't shown us what that image looks like so we can only guess what's gone wrong. Same applies to the other textures you've used.

In short, help us to help you.



Powered by Free Banners
TheViking
13
Years of Service
User Offline
Joined: 16th Feb 2012
Location:
Posted: 23rd Oct 2014 01:37
Hey,

Textures seem to be working fine now, it was simply that I was putting 3 layers on it instead of two. Attached is a picture, which is really just a solid grey for the land for now.



As you can see, there is now a black outline along with the blue tint for the shadows, though they seem blocky, I assume too big of polys.

@GG, sorry I wasn't thorough enough when posting, sometimes I don't thing of all the little details like the textures. But, now I got it working. Thanks though.

As far as the lighting goes... I understand the idea on how to do it, however, I am poor with shader coding, so it's difficult for me to find out what to alter. I'm not asking the typical "do this for me" we've all seen before, lol. It's just been so long since I've touched Shaders and DBP that I'm very rusty...

Thanks for all the help
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Oct 2014 11:30
You're welcome. We all overlook simple things from time to time.

Thanks for letting us know.



Powered by Free Banners

Login to post a reply

Server time is: 2025-05-12 12:05:12
Your offset time is: 2025-05-12 12:05:12