Welcome, Guest.
Username: Password: Remember me

TOPIC: Paint and Outline

Paint effect and depth-buffer based cel shading 4 years 4 months ago #21

TrophiHunter wrote:
Hi JPulowski, is it possible to change the color of cel shading to like white or something? if so can you explain how? Love the Effects. :)
NattyDread wrote:
I would also like to see the Cel expanded with opacity and color value if it's possible. Fade with distance and outline width would be most welcome also.
The original algorithm belongs to kingeric1992, but I'll see what I can do. :)
The administrator has disabled public write access.
The following user(s) said Thank You: NattyDread, TrophiHunter

Paint effect and depth-buffer based cel shading 4 years 4 months ago #22

@JP

haven't tested yet, but try this:
//    replace this line
//	color -= step(1, sqrt( dot(dotx, dotx) + dot(doty, doty))); // original color -1 when weight over 1
//    to this
	color.rpg  = lerp(color.rpg, Cel_Color,  step(Cel_Threshold, sqrt( dot(dotx, dotx) + dot(doty, doty)))); // return custom color when weight over threshold
//    needs to add these in config file
//    #define Cel_Color              float3( 0.0, 0.0, 0.0) //[0,1] color
//    #define Cel_Threshold    1                                    // ignore soft edges( less sharp corner) when increased

also if you replace buffer color input to custom background color, it should looks like some cool skeleton looks.

@Wicked Sick
Blame!!!!
I love it!!! (✪ω✪)
Including other series by the author, gives some sort of post-bio-apocalypse feels.
東亜重工 rules!!

Should add a cross-hatching shader, with dot pattern, it recreate comic/manga process where you apply doted sheet for greyscale.
Last Edit: 4 years 4 months ago by kingeric1992.
The administrator has disabled public write access.
The following user(s) said Thank You: JPulowski

Paint effect and depth-buffer based cel shading 4 years 4 months ago #23

That bit of Code works but you dont need the color.rpg just color works for me
The administrator has disabled public write access.

Paint effect and depth-buffer based cel shading 4 years 2 months ago #24

Here's another one (cel with AO in debug mode):

The administrator has disabled public write access.
The following user(s) said Thank You: JPulowski, Ioxa, klotim, jas01, Anal_destroyer

Paint effect and depth-buffer based cel shading 4 years 2 months ago #25

With this tech, is it possible to make a shader that does this:


Before: lh3.ggpht.com/-GgLJW50a1NY/U4TQeAN-OHI/A...a2d8c6ec672b30f1.jpg

After: oi59.tinypic.com/24pvs55.jpg



Like instead of paint, have some bilinear filtering cover the areas in depth instead?
Last Edit: 4 years 2 months ago by Sh1nRa358.
The administrator has disabled public write access.

Paint effect and depth-buffer based cel shading 4 years 1 month ago #26

One more with all kinds off goodies on it (Cel, Paint, LUT, DoF and AO)

The administrator has disabled public write access.
The following user(s) said Thank You: JPulowski, Wicked Sick, jas01

Paint effect and depth-buffer based cel shading 4 years 1 month ago #27

I've been playing around with 3dsmax lately and I found a menu with a bunch of "stylized" shaders. Would any of you be able to port them to Reshade?

imgur.com/a/gmBHM
Last Edit: 4 years 1 month ago by Nerd.
The administrator has disabled public write access.

Paint effect and depth-buffer based cel shading 4 years 1 month ago #28

NattyDread wrote:
One more with all kinds off goodies on it (Cel, Paint, LUT, DoF and AO)
Woah.... Nice. Mind sharing your preset? :) (Witcher 3 and Mad Max)
Last Edit: 4 years 1 month ago by jas01.
The administrator has disabled public write access.

Paint effect and depth-buffer based cel shading 4 years 1 month ago #29

Nerd wrote:
I've been playing around with 3dsmax lately and I found a menu with a bunch of "stylized" shaders. Would any of you be able to port them to Reshade?

imgur.com/a/gmBHM
Sure. As long as one has access to the source code.
The administrator has disabled public write access.

Paint effect and depth-buffer based cel shading 3 years 10 months ago #30

I know it has been some time but...
Updated Cel shader (Now "Outline" shader) and added kingeric1992's suggestions and few other requested features except width modifier which will require some work. Here is the changelog:
1.2  - Changed the name to "Outline" since technically this is not Cel shading (See https://en.wikipedia.org/wiki/Cel_shading)
       Added custom outline and background color support
       Added a threshold and opacity modifier
Anyone who is interested might find the new version at our GitHub repository. Enjoy. :)
The administrator has disabled public write access.
The following user(s) said Thank You: Wicked Sick, NattyDread, SpinelessJelly

Paint effect and depth-buffer based cel shading 3 years 5 months ago #31

Can i use the paint shader and outline shader with ReShade_1.1.0_with_SweetFX_2.0?
Im using for fallout 4

Im fairly new at this so i dont know how i would go about doing this if it works that it?
Last Edit: 3 years 5 months ago by speaker60.
The administrator has disabled public write access.

Paint effect and depth-buffer based cel shading 2 years 11 months ago #32

Yo'all

I'm trying to find the shaders but noluck for the paint shader. It seems that the cell shader was deleted from repository but I managed somehow to get the file
raw.githubusercontent.com/crosire/reshad...0/Shaders/Outline.fx (for reshade 3)

So now I'm looking for the paint shader but I can't find it on reshade 3 options... Any suggestion?

On the other hand I was wondering about if the following images are achievable?

imgur.com/a/1wHhe#0

Regards
JPulowski
crosire
OtisInf
Marty McFly
kingeric1992
NattyDread
Last Edit: 2 years 10 months ago by toomighty.
The administrator has disabled public write access.
The following user(s) said Thank You: One3rd

Paint effect and depth-buffer based cel shading 2 years 10 months ago #33

up
The administrator has disabled public write access.

Paint effect and depth-buffer based cel shading 2 years 10 months ago #34

toomighty wrote:
I'm trying to find the shaders but noluck for the paint shader. It seems that the cell shader was deleted from repository but I managed somehow to get the file
raw.githubusercontent.com/crosire/reshad...0/Shaders/Outline.fx (for reshade 3)

So now I'm looking for the paint shader but I can't find it on reshade 3 options... Any suggestion?
Thanks for this, I've been looking for that Outline shader for v3 but hadn't been able to find it. It works like before except the EdgeDetectionMode selection seems to be inversed; color edge detection is depth edge detection and vice versa.

I too would like to know if there is a version of the paint shader that works with Reshade v3. Are the results in those images you posted from the paint shader in Reshade v2 or an external filter?
The administrator has disabled public write access.

Paint effect and depth-buffer based cel shading 2 years 10 months ago #35

bump

Was wondering if there are any plans to release the cel and paint shader now that the new reshade version is out.
i got the outline fx to run but no luck with the paint shader sofar.
The administrator has disabled public write access.

Paint effect and depth-buffer based cel shading 2 years 9 months ago #36

One3rd wrote:
toomighty wrote:
I'm trying to find the shaders but noluck for the paint shader. It seems that the cell shader was deleted from repository but I managed somehow to get the file
raw.githubusercontent.com/crosire/reshad...0/Shaders/Outline.fx (for reshade 3)

So now I'm looking for the paint shader but I can't find it on reshade 3 options... Any suggestion?

I too would like to know if there is a version of the paint shader that works with Reshade v3. Are the results in those images you posted from the paint shader in Reshade v2 or an external filter?

Those images are the result from photoshop filter. I'm trying to support modders to eventually make a better paint shader than the basic one which is right now avalaible. Regards
The administrator has disabled public write access.

Paint effect and depth-buffer based cel shading 2 years 9 months ago #37

which one is currently available for reshade 3? since i can t find it anywhere
The administrator has disabled public write access.

Paint effect and depth-buffer based cel shading 2 years 9 months ago #38

toomighty wrote:
Yo'all

I'm trying to find the shaders but noluck for the paint shader. It seems that the cell shader was deleted from repository but I managed somehow to get the file
raw.githubusercontent.com/crosire/reshad...0/Shaders/Outline.fx (for reshade 3)

So now I'm looking for the paint shader but I can't find it on reshade 3 options... Any suggestion?

On the other hand I was wondering about if the following images are achievable?

imgur.com/a/1wHhe#0

Regards
JPulowski
crosire
OtisInf
Marty McFly
kingeric1992
NattyDread
Just drop Outline.fx into ../reshade-shaders/Shaders/ folder and it should be good to go. As for the paint shader i believe Crosire chose not to include it in the repository due to its performance-heavy nature since it is not that well suited for real-time tweaking. But I'll do a port for those who would like to use it. I'll submit it here after I am done.

Update: Here it is. Just save it as Paint.fx and drop it into ../reshade-shaders/Shaders/.
/**
 * Basic kuwahara filtering by Jan Eric Kyprianidis <www.kyprianidis.com>
 * https://code.google.com/p/gpuakf/source/browse/glsl/kuwahara.glsl
 * 
 * Copyright (C) 2009-2011 Computer Graphics Systems Group at the
 * Hasso-Plattner-Institut, Potsdam, Germany <www.hpi3d.de>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * Paint effect shader for ENB by kingeric1992
 * http://enbseries.enbdev.com/forum/viewtopic.php?f=7&t=3244#p53168
 * 
 * Modified and optimized for ReShade by JPulowski
 * https://reshade.me/forum/shader-presentation/261
 * 
 * Do not distribute without giving credit to the original author(s).
 * 
 * 1.0  - Initial release/port
 * 1.0a - Modified the code to make it compatible with SweetFX 2.0 Preview 7 and new Operation Piggyback which should give some performance increase
 * 1.1  - Removed SweetFX Operation Piggyback compatibility
 *        Added Framework compatibility
 * 1.2  - Rewritten and optimized some parts of the code
 * 1.3  - Port to ReShade 3.x
 */

uniform int PaintRadius <
	ui_type = "drag";
	ui_min = 0; ui_max = 20;
	ui_tooltip = "Amount of effect. Higher values require more performance.";
> = 2;

#include "ReShade.fxh"

float3 PS_ModePaint(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target
{
	float4 col;
	float3 lumcoeff = float3(0.2126, 0.7152, 0.0722) * 9.0; // Multiplied by total number of available intensity levels
	
	float4 col0 = 0.0; float4 col1 = 0.0; float4 col2 = 0.0; float4 col3 = 0.0; float4 col4 = 0.0;
	float4 col5 = 0.0; float4 col6 = 0.0; float4 col7 = 0.0; float4 col8 = 0.0; float4 col9 = 0.0;
	
	for (int i = -PaintRadius; i <= PaintRadius; i++) {
		for (int j = -PaintRadius; j <= PaintRadius; j++) {
			col.rgb = tex2D(ReShade::BackBuffer, texcoord + ReShade::PixelSize * float2(i, j)).rgb;
			col.a   = round(dot(col.rgb, lumcoeff)) + 1.0;	// Store intensity in alpha channel and increase it by 1, so we can count
															// values between 0.0 - 1.0
			col0 += col.a ==  1.0 ? col : 0.0;
			col1 += col.a ==  2.0 ? col : 0.0;
			col2 += col.a ==  3.0 ? col : 0.0;
			col3 += col.a ==  4.0 ? col : 0.0;
			col4 += col.a ==  5.0 ? col : 0.0;
			col5 += col.a ==  6.0 ? col : 0.0;
			col6 += col.a ==  7.0 ? col : 0.0;
			col7 += col.a ==  8.0 ? col : 0.0;
			col8 += col.a ==  9.0 ? col : 0.0;
			col9 += col.a == 10.0 ? col : 0.0;
		}
	}

	// Calculate intensity count
	col1.a /=  2.0;
	col2.a /=  3.0;
	col3.a /=  4.0;
	col4.a /=  5.0;
	col5.a /=  6.0;
	col6.a /=  7.0;
	col7.a /=  8.0;
	col8.a /=  9.0;
	col9.a /= 10.0;
	 
	 col.a  =  0.0;
	
	// Calculate mode
	col = col0.a > col.a ? col0 : col;
	col = col1.a > col.a ? col1 : col;
	col = col2.a > col.a ? col2 : col;
	col = col3.a > col.a ? col3 : col;
	col = col4.a > col.a ? col4 : col;
	col = col5.a > col.a ? col5 : col;
	col = col6.a > col.a ? col6 : col;
	col = col7.a > col.a ? col7 : col;
	col = col8.a > col.a ? col8 : col;
	col = col9.a > col.a ? col9 : col;
	
	return col.rgb / col.a;
}

float3 PS_Kuwahara(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target
{
	float n = pow(PaintRadius, -2.0);
	float4 col = 1.0;
	
	// Using vectors instead of arrays, otherwise temp register index gets exceeded very quickly
	float4 m0 = 0.0, m1 = 0.0, m2 = 0.0, m3 = 0.0;
	float3 s1 = 0.0, s2 = 0.0, s3 = 0.0, s4 = 0.0;
	
	for (int i = 0; i < PaintRadius; i++) {
		for (int j = 0; j < PaintRadius; j++) {
			col.rgb = tex2D(ReShade::BackBuffer, texcoord + float2(-i, -j) * ReShade::PixelSize).rgb;
			m0.rgb += col.rgb;
			s1 += col.rgb * col.rgb;
			
			col.rgb = tex2D(ReShade::BackBuffer, texcoord + float2( i, -j) * ReShade::PixelSize).rgb;
			m1.rgb += col.rgb;
			s2 += col.rgb * col.rgb;
			
			col.rgb = tex2D(ReShade::BackBuffer, texcoord + float2( i,  j) * ReShade::PixelSize).rgb;
			m2.rgb += col.rgb;
			s3 += col.rgb * col.rgb;
			
			col.rgb = tex2D(ReShade::BackBuffer, texcoord + float2(-i,  j) * ReShade::PixelSize).rgb;
			m3.rgb += col.rgb;
			s4 += col.rgb * col.rgb;
		}
	}
	
	m0.rgb *= n; m1.rgb *= n;
	m2.rgb *= n; m3.rgb *= n;
	
	// Sigma2
	m0.a = dot(distance(s1.rgb * n, m0.rgb * m0.rgb), 1.0);
	m1.a = dot(distance(s2.rgb * n, m1.rgb * m1.rgb), 1.0);
	m2.a = dot(distance(s3.rgb * n, m2.rgb * m2.rgb), 1.0);
	m3.a = dot(distance(s4.rgb * n, m3.rgb * m3.rgb), 1.0);
	
	col = m0.a < col.a ? m0 : col;
	col = m1.a < col.a ? m1 : col;
	col = m2.a < col.a ? m2 : col;
	col = m3.a < col.a ? m3 : col;
	
	return col.rgb;
}

technique Kuwahara
{
	pass Kuwahara
	{
		VertexShader = PostProcessVS;
		PixelShader = PS_Kuwahara;
	}
}

technique kingeric1992
{
	pass kingericPaint
	{
		VertexShader = PostProcessVS;
		PixelShader = PS_ModePaint;
	}
}
Last Edit: 2 years 9 months ago by JPulowski.
The administrator has disabled public write access.
The following user(s) said Thank You: Rudy102

Paint effect and depth-buffer based cel shading 2 years 9 months ago #39

Update: Here it is. Just save it as Paint.fx and drop it into ../reshade-shaders/Shaders/.
thank you for Paint.fx ! but why it can not be loaded by reshade3.06?
Last Edit: 2 years 9 months ago by hunt1hunt.
The administrator has disabled public write access.

Paint effect and depth-buffer based cel shading 2 years 9 months ago #40

hunt1hunt wrote:
Update: Here it is. Just save it as Paint.fx and drop it into ../reshade-shaders/Shaders/.
thank you for Paint.fx ! but why it can not be loaded by reshade3.06?
Can you describe the issue more in detail? Is there any error messages? Or does it simply not show up in the UI? For the latter make sure that you have dropped the shader in the correct folder, even though there was something wrong ReShade always loads .fx files automatically, so any errors or whatsoever would trigger a message in the UI.
The administrator has disabled public write access.