Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

[Solved] Scale from middle shader

$
0
0

@Razputin wrote:

Hi,

I'm new to shaders and having trouble with one that I'm sure must be quite simple. I want a texture that grows from the center continually, half my problem is I don't know what to call this, so it's hard to google it.

So this is the pattern and I want this to look like it continually sprouts new copies from the middle... I hope I'm making sense.

Here's what I have so far

float4 color = tex2D(TextureSampler, input.TexCoords) * input.Color;
float2 center = float2(.5, .5);
Zoom = (AutoZoom * Time) % 1;
float2 deltaCenter = normalize(center - input.TexCoords);
float2 patternCoords = center + (deltaCenter * Zoom);
float4 color2 = tex2D(PatternTextureSampler, patternCoords);
color2 *= color.a;
color += color2 * Intensity;
return color;

This results in this very bad stretch

Any guidance would be very much appresiated.

Pablo

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles