Home > other >  For a sea urchin shaped shader idea
For a sea urchin shaped shader idea

Time:09-24



Want to draw a directly with shader, sea urchin shaped ball out of the 2 d texture (above is solid, here I omit drew), but there has been no thought, pure simple spherical, but these really beats me,,, all blame geometry to learn at school, now a way to give a train of thought, it is best to have a reference source, or any other languages, stopping rz

CodePudding user response:

So why ah, no 2333

CodePudding user response:

Will write programs, will not draw texturing,

CodePudding user response:

Using a shader? Do you want to stroke? Touch type shader is used to do? Would you want to the wrong direction,

CodePudding user response:

reference lovesmiles reply: 3/f
use shader? Do you want to stroke? Touch type shader is used to do? Would you want to the wrong direction,


No, I just want to try this shader directly draw a graph on a mesh, calculate the uv coordinates, trying to play, does not involve the model,

CodePudding user response:

refer to the second floor wuyt2008 response:
can write programs only, won't draw maps, said


Ha ha ha, that's ok, I also drew a circle before, suddenly want to give it a try, add a thorn

CodePudding user response:

According to the UV can be calculated from the Angle of the center position and then according to the Angle change is given different radius, you can use a mathematical formula, such as sine cosine even sharper function and then later you will understand

CodePudding user response:

Pure is to look at solutions,

CodePudding user response:

Don't steal art job!

CodePudding user response:

The building Lord seek out yet?
I use a similar to you render monkey play of sea urchin computation more I will not make the

Core is a function fmod



Sampler2D Texture0;

Float subRadius;

Float AnglePercent;

Float Test;

Float PI=3.1415926 f;
Float TwoPI * 2.0=3.1415926 f f;

Float4 ps_main (float2 texCoord: TEXCOORD0) : COLOR
{

Float4 sceneColor=tex2D (Texture0 texCoord);
Float4 final;

Float2 DisToCenter;

DisToCenter. X=texCoord. X - 0.5 f;
DisToCenter. Y=texCoord. Y - 0.5 f;

Float Dis=SQRT (DisToCenter. X * DisToCenter. X + DisToCenter. Y * DisToCenter y);

Final=subRadius & gt; Dis? SceneColor: 1.0 f;

Float per=DisToCenter. X & gt; 0? A cosine (- DisToCenter. Y/Dis)/TwoPI * 0.99 f: (TwoPI - a cosine (- DisToCenter. Y/Dis))/TwoPI * 0.99 f;

Final. X=fmod (per AnglePercent)/AnglePercent;


Return the final;
}

CodePudding user response:

Learn ing...
  • Related