Code Monkey home page Code Monkey logo

Comments (2)

Jim-Dev avatar Jim-Dev commented on September 15, 2024

I don't have too much experience in shaders but I'm making some test on my own, i changed the HeightDrip.shader shader, i've replaced FlowDirection with a Flow map texture, with it's corresponding texture sampler.

sampler2D _MainTex;
sampler2D _FlowTex;
float4 _MainTex_ST;
float4 _MainTex_TexelSize;
float4 _FlowTex_TexelSize;
float2 getNormalizedFlowPoint(float2 uv)
{
	return float2 (tex2D(_FlowTex, uv).rg * 2.0f - 1.0f);
}
...
float2 shiftZ = float2(getNormalizedFlowPoint(i.uv).x * _FlowTex_TexelSize.x, getNormalizedFlowPoint(i.uv).y * _FlowTex_TexelSize.y) * _ScaleFactor * _Viscosity * VITIATE_Z;
float2 shiftX = float2(_FlowTex_TexelSize.x * getNormalizedFlowPoint(i.uv).y, _FlowTex_TexelSize.y * getNormalizedFlowPoint(i.uv).x) * _ScaleFactor * _Viscosity * VITIATE_X;
float2 shiftx = -shiftX;

And i'ts working almost right, but i have a problem, when i specify a totally gray map RGB(0.5,0.5,0.5,1), even when the flow shouldn't move, it start drifting slightly to to upper right corner (in a test plane, at the UV coordinates 1,1)

if it's help in something, i could add a PR with my modifications to the 'Still not working completelly' HeightDrip shader, and the test Flowmaps textures to recreate the testing case.

from inkpainter.

EsProgram avatar EsProgram commented on September 15, 2024

very pleased to cooperate to make InkPainter better.
pull requests are always welcomed.
thank you!

from inkpainter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.