esprogram / inkpainter Goto Github PK
View Code? Open in Web Editor NEWTexture-Paint on Unity.
Home Page: https://esprogram.github.io/InkPainterDocument/
License: MIT License
Texture-Paint on Unity.
Home Page: https://esprogram.github.io/InkPainterDocument/
License: MIT License
Dear amazing inkPainter developper,
I would like to congratulate you on your amazing asset. For my project, I'm importing house at runtime and I wanted to use you asset to paint the walls of the imported 3D model. Unfortunately adding the inkCanvas component with AddComponent<> does not work at runtime because of the custom editor (paintSet object was null). So i added in the "Awake" function the following method base on your code :
private void CreateRuntimeProperty()
{
Renderer renderer;
Material[] materials;
List<bool> `foldOut;`
var instance = this;
instance.paintSet = new List<PaintSet>();
renderer = instance.GetComponent<Renderer>();
materials = renderer.sharedMaterials;
foldOut = new List<bool>();
if (instance.paintSet.Count < materials.Length)
{
for (int i = instance.paintSet.Count; i < materials.Length; ++i)
instance.paintSet.Add(new PaintSet
{
mainTextureName = "_MainTex",
normalTextureName = "_BumpMap",
heightTextureName = "_ParallaxMap",
useMainPaint = true,
useNormalPaint = false,
useHeightPaint = false,
});
foldOut.Clear();
}
if (instance.paintSet.Count > materials.Length)
{
instance.paintSet.RemoveRange(materials.Length, instance.paintSet.Count - materials.Length);
foldOut.Clear();
}
if (foldOut.Count < instance.paintSet.Count)
for (int i = foldOut.Count; i < instance.paintSet.Count; ++i)
foldOut.Add(true);
}
This seems to be because WorldPoint defaults to PaintNearestTriangleSurface() which then triggers an endless loop. To reproduce this, go to blender, use any basic object such as a sphere, and attempt to paint it. About halfway down the sphere, Unity will freeze for about a minute, multiple "Could not get point on surface" messages will appear, and then finally a StackOverflowException. I've also tested this on imported models on the asset store with similar results.
Hi,
Thanks for this wonderful asset. I'm trying to create a scenario where a texture needs to be painted over to complete a level. Is there a way to determine how much of the texture is painted? For example, I'm looking for something like a percentage that indicates if a texture has been 40% covered by paint.
Thanks.
Hi,
Really helpful asset.
I was wondering if you can help with checking what percentage of texture has been painted and how much percentage is remaining (yet to be painted)?
Thanks much!
FluidPaintで、接空間上の法線に影響を受けて流れ方が変わるようにしたい
Alpha of HeightFluid is added every time drawing processing.
Current synthesis is addition synthesis of RGB.
When I use ProBuilder to create objects and add the canvas script to them it messes up the UV layout and only pushes it all down to one square of the texture in the corner. I think it something to due with the UV wrapping that ProBuilder generates and what textures Ink Painter requires. It has something to with the tiling of the UV wrap
When NormalMap is saved during play mode with InkPainter, it is output in DXT5nm color
The liquid stopped by the optimization of the dripping treatment flows out again in the subsequent paint.
Implementation of texture and editor extension to store drifting directions for FluidPaint.
HeightFluid does not correspond to an object with two or more materials.
タイトル通り。
PaintMapからDiffuse(カラーマップ)への書き込みの際に、アルファ値だけ別途渡してシェーダー内で合成するといった処理が必要になる。
Added function to rotate the brush.
Material of InkPainter is updated after play mode.
It is necessary to change so that the serialized data is not updated.
Make RenderTexture correspond to Repeat shading.
https://twitter.com/nagome75/status/852780287435997190
I need to have a uniform size when painting on a large surface
HeightMap is generated inside HeightFluid, and display is wrong if _PARALLAXMAP is added to KeyWords of StanderdShader.
If InkCanvas depends on Collider, the constraint may be too strong and inconvenient.
CollisionPainter + Ink Canvas work the first time. But after SceneManager.LoadScene(.SceneManager.GetActiveScene().name) CollisionPainter + Ink Canvas do not work.
Added automatic performance optimization function of HeihtFluid.
https://twitter.com/Es_Program/status/852931692901810176
Create HeightFluid's CustomInspector.
log error is
Material doesn't have a texture property '5f4d61696e546578' UnityEngine.Material:GetTexture(Int32) Es.InkPainter.InkCanvas:SetTexture() (at Assets/InkPainter/Script/Core/InkCanvas.cs:283) Es.InkPainter.InkCanvas:Awake() (at Assets/InkPainter/Script/Core/InkCanvas.cs:199)
my unity version is 5.5.2f1
If you use InkCanvas for materials created with older versions, it will be strange to display. (UV shift?)
Make a new material and fix it by setting the same shader and properties.
Changing shaders and properties of old materials will not fix it.
As it is on the image, the copy itself to the RenderTexture is successful.
Incidentally, it does not occur when painting to MainTexture is not done.
I want something when the player collides with the target it paints with dripping paint same as when we paint by mouse click. How can i achieve the same thing on collision?
Hi, I noticed ease of dripping is different when painting over clean areas and already painted areas (color flows further over paint). Yet I haven't been able to find the factor which makes it different, how can I modify inkpainter so that ease of dripping is the same no matter where I paint?
What I want to do is to make color spread to be the same as ink dripping, I have been playing around with HeightDrip.shader, PaintHeight.shader and InkPainterFoundation.cginc, but I haven't been able to get such results, every factor in shiftZ seems to end up affecting both dripping and color spread, I haven't found which one affects only color spread.
Thanks.
If Height Fluid script is added, then erasing paints white basically.
Right now the Heightdrip shader uses a vector2 (float2) to specify the flow direction for the dripping effect, would be really useful if we could specify a flow map to control the direction.
maybe related to #25 ?
Erase of NormalMap does not work properly
It seems that the blending does not work properly for transparent textures?
With non-transparent sample textures looks like https://gyazo.com/71c30d57fe3bf1dc1921a9670b11039c
With transparent texture looks really bad
https://gyazo.com/710b504578265e45c7a75b6bc883d3fd
When the texture is set to tile, each of the paint is being applied to every single tile.
Added a function to select material to paint.
Currently, I paint all materials registered in InkCanvas.
Can you select a license and add it to the project please, because due to license missing it is unclear how people can use the project.
Hi. I thank you because your assets are very useful for me to work on the project. but, i need one very important functionality, that is undo and redo. can you give me a hint? maybe we can discuss together. thanks.
HeightFluid does not work properly when ColorSpace is set to Linear.
https://twitter.com/onotchi_/status/852526700550213637
Shader error on android build.
If HeightFluid and InkCanvas have different NormalMapPaint settings, no normal map is set for material, and HeightFluid generates RenderTexture for NormalMap, it becomes black image and it becomes gloomy shading.
When doing NormalMapFluid with HeightFluid, if the normal map is specified for the material, you can leave it as it is now.
If you do not specify a normal map and want to do NormalMapFluid, you need to fill in the RenderTexture with the default normal rgb (128, 128, 255) for RenderTexture after generating it. It can filled with SingleColorFill. When treating it as a DXT 5 mn format when calculating Normal Map in Shader, define Pack Normal function in C # (defined in Shader) and apply it to rgb (128, 128, 255) and initialize with that color.
Make cginc reference a relative path
Is it possible to add support for painting 2d sprites?
Implementation of an eraser that can partially erase paint.
Misspelling of the scene name. "Hight" -> "Height"
Is it possible to paint an object with different height fluids?
I've recognized once the last painted color is different than the current one, fluid process stops. Is it possible to keep fluid process when a different color is applied? I want to apply 3 distinct and certain colors to the object and all of them to be fluid.
Thx.
When changing the brush's alpha at runtime causes only the last or the latest painted brush to simulate fluidic effects (see screenshot) (Modifying scale works fine)
(Note: How can I change the width and height in scale separately?)
(Note2: Changing the alpha in HeightFluid changes the alpha of all the painted brushes
This is how I change alpha in the Update() function
//vars
public InkCanvas inkCanvas; //set in inspector
private static readonly System.Random random = new System.Random();
float dampedAlpha;
//functions
private void Update()
{
if(Input.GetMouseButton(0))
{
var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hitInfo;
if(Physics.Raycast(ray, out hitInfo))
{
dampedAlpha = Mathf.SmoothDamp(dampedAlpha, (float)RandomNumberBetween(0f,1f), ref vel, Time.fixedDeltaTime);
Brush tempBrush = brush;
tempBrush.Color = new Color(brush.Color.r,brush.Color.g,brush.Color.b,dampedAlpha);
inkCanvas.Paint(tempBrush, hitInfo);
}
}
}
private static double RandomNumberBetween(double minValue, double maxValue)
{
var next = random.NextDouble();
return minValue + (next * (maxValue - minValue));
}
Steps to Reproduce:
Color Blend Type = Alpha Only
Normal Blend Type = Add
Height Blend Type = Use Brush
It would be great if we could add ink canvas to objects at runtime with addcomponent
thanks!
Hey!
I love your ink painter asset and have converted it a little to work in our top down shooter, and it works fine but we need it so that players and enemies can read which colour is below them to activate certain effects on them i.e. speed boost etc. Was wondering if you had any advice or knowledge on how to do this?? I've tried GetPixel but doesn't seem to work because the mainTexture of the ground is changed to something that i don't know what it is. Looking through your scripts gave me the idea for GetVector but im not entirely sure how that would work.
Dear InkPainter programmer,
Painting texture only works when the uvs are not repeating on the texture. Otherwise, we get the following behaviour as shown in the .gif (your sample cube vs unity cube). Is there a solution for this problem ? Can we modify the uv through script so that we do not have a repetition ?
Thank you again for your response,
Make Ink Painter compatible with unity terrains.
Please add a wipe effect..
Erase function does not work properly with Brush setting Rotate.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.