I’ve managed to achieve this result with unlit emissive material. I used a texture as the emissive color and to get rid of the glow, I multiplied by 0.05. I would imagine if you made a game with entirely emissive materials, there would be no need for any lighting, but I’m sure the amount of texture data would explode.
Here’s the result under different light environments:
Here’s the very simple graph:
Here’s what it looks like with sobel edge:
I think I prefer it with sobel edge turned off.
The problem with this is that of course you wont have any shading due to lights so it’s not really cell shading. I would imagine you could create a blueprint to detect amount of light hitting the model and modify the constant multiplier in the emissive property accordingly to brighten or darken the model. However, I don’t yet have enough familiarity with the engine to be able to do that just yet.
The model is not mine. I found her on deviantart and the creator is
heya!
I’m working with this for a game and have been running into an issue of when you go into an enclosed level it ramps up the gamma super high, but if you move the camera it changes back to being dark than ramps again. Anyone else ran into this or something like it?
That looks really cool, tkchen. A little while back there was a cool discussion about 2D looking 3D effects and there were some nice, pretty convincing methods discussed. I particularly liked the idea of driving a texture with the shading.
In post processing, under auto exposure, you can change your exposures to your paticular needs. (sorry if it took that long. I just had that eureka moment.)
Hello. I’ve been trying to recreate JvtheWanderer’s cell shader, but I keep bumping into problems. I recreated everything I saw in the pictures and then applied the post-process material to a post-process volume, but this is the result I get:
Here’s a few screens of my material:
I also tried removing ElliotB’s Custom Depth Debuffer, but then this happens:
Can anyone help me figure out what I’m doing wrong? Is there some component I’m missing?
Same thing happens with more bands. You can still see through the black shadow. Another thing is that there’s no AA on the effect. It seems like it’s being rendered after all the AA processes has already been rendered. Is there a way to make it cell shader render earlier? I’m very new to shader programming. I mostly reverse-engineer a lot of materials in order to see and learn how they’re made. I’m trying to understand how to apply “Temporal Anti-Aliasing” like shown in this documentation page.
Could it be a problem with my graphics card? I use an AMD Radeon HD 6800 Series.
The problem I have now is that the light/shadows seems to be inverted. You can see that the shadows on the ground conflict with the self shadowing. The shadows on the ground cast a shadow to the right versus the self shadow that casts a shadow to the left. I can’t tell where I made a mistake since JvtheWanderer’s screenshots are so low resolution. Can anyone please help me figure this out?
Any chance of posting your BP so I can take a look at your changes and see if I can figure out a solution? All I’m getting now after tinkering is a pure-black screen so it might be refreshing to look at someone elses BP.
Sure. After studying the stylized showcase I found that what I was doing wrong was putting the post process material straight into the post process volume. The thing I had to do instead was to create a material instance referring to the post process material and put that instance material into the post process volume. Same for the outline material except that the skydome still has those weird rings on it.
It was apparently as a result of me not having rebuilt the lightning. Works like a charm now. But as a side note, is there no way to replace the ceil with a ramp texture? My old shader in UDK used a texture to define the steps of the cel shader. I started a thread about it here.
Yup, should be able to just feed in the initial brightness of the pixel (which above you multiply by # of bands, take ceil of, then divide by # of bands) as a UV coordinate for your ramping texture. Probably a good idea to clamp it between 0 and 1 first to prevent any strange artefacts.
This is actually what the shader you link two does; the brightness of the pixel gets used as the first coordinate, and some other parameter termed ‘detail shading type’ gets used for the second coordinate. The ‘Cel Texture’ is then used as a map to select some color for given illumination and ‘detail shading type’ (which i guess is some function of distance from the camera).
If ‘Cel Texture’ was smooth, you’d get smooth shading. If it were banded, you’d get a cel shaded effect, which is what you are after.
Okay, thanks dude. But when I try to use a Param2D or a Texture Sample, I get the error message"[SM5] (Node Multiply) Arithmetic between types float4 and float3 are undefined". How do I fix this? Thanks for your help:)
Managed to fix it. Float 4 apparently means that it has an alpha channel in addition the the 3 RGB channels. I just added just the RGB channels and then plugged it in:
The problem that now comes up is that there’s an extra band where it doesn’t need to. The band texture shows only 2 bands, but the model displays 3.
The 3rd band disappears when it’s in a shadow.
Does anyone know why this happens? Why do the 3rd band disappear when it goes into the shadows? Is there a way to remove it completely?
Edit: Here are a few screens of it with “lightning only” turned on.
It’s because you’re adding the texture to itself, you actually want to mask it with a ‘component mask’ node and make sure that R, G and B is checked. However what you’re doing right now is creating a single scalar value which is R, G and B combined, NOT a Vector3.
Using the white output of a texture shouldn’t give you RGBA though, that’s just RGB combined. What’s the rest of the material network like? It sounds like there’s an error with the material elsewhere in the network. You can multiply a scalar by anything, but not a Vector3 (well you can, but not without errors).
Also, emissive materials do not receive ANY lighting information. The lighting in your model above hasn’t flipped, it’s just the information from the texture.
I had to use the component mask on each module in order to remove the error with “[SM5] (Node Multiply) Arithmetic between types float4 and float3 are undefined”, not just the texture. But I still have the same problem with having 3 bands instead of 2. All that did was just turning the scene a little darker.