# Sprite model? How did they do this?

**URL:** <https://forums.unrealengine.com/t/sprite-model-how-did-they-do-this/2968>\
**Category:** Character & Animation\
**Tags:** unreal-engine\
**Created:** [April 21, 2014, 1:34am UTC](https://forums.unrealengine.com/t/sprite-model-how-did-they-do-this/2968 "2014-04-21T01:34:46Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![Jonas\_Molgaard](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jonas\_Molgaard](https://forums.unrealengine.com/u/Jonas_Molgaard)\
**Post date:** [September 22, 2016, 5:13pm UTC](https://forums.unrealengine.com/t/sprite-model-how-did-they-do-this/2968/21 "2016-09-22T17:13:46Z")

</div>

Tbh. im not that advanced with materials yet, so no i haven’t tried using “paint verticies lerp along axis”, but from the name of it, it sounds like it could very much be usefull in this situation. I will investigate this. That other stuff you write about encoding, im sure i’ll understand later, but hopefully someone else can make use of it. In the meantime i tried out a different approach and wanted to hear your oppinion on that. I do realize this will not work with a merged actor, and then i would need to take care of the thickening like you do. But instancing a new material like i do with each Splinemeshcomponent, is that a total no-no?

[![]( " - YouTube") ](https://www.youtube.com/watch?v=xmjvh0Qajo8)

---

<div class="post-metadata">

**Author:** ![RyanB](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyanB](https://forums.unrealengine.com/u/RyanB)\
**Post date:** [September 22, 2016, 5:41pm UTC](https://forums.unrealengine.com/t/sprite-model-how-did-they-do-this/2968/22 "2016-09-22T17:41:56Z")

</div>

Its not the worst thing in the world from a prototype perspective but I wouldn’t go shipping any games like that since it won’t be very efficient.

If all you are doing is making the sub branches start a bit thinner, you can simply paint a solid color on each segment that represents how far along the parent it was when spawning (you will want to invert it by doing 1-x once its in the 0-1 range). Then you just multiply the width param by that vertex color. Should actually be simpler than making separate MIDs per branch.

---

<div class="post-metadata">

**Author:** ![Jonas\_Molgaard](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jonas\_Molgaard](https://forums.unrealengine.com/u/Jonas_Molgaard)\
**Post date:** [September 22, 2016, 6:46pm UTC](https://forums.unrealengine.com/t/sprite-model-how-did-they-do-this/2968/23 "2016-09-22T18:46:33Z")

</div>

I kinda knew you’d say that hehe. That’s why i wanted to convert this to a static mesh without all the generation logic and material logic. So the thing is, i do understand the concept you say about painting a solid color for each segment as a representation for how far along the parent it is, but i just don’t know how to do that. And on top of that, my UV’s for the strip i use, is the same for the generated merged Static Mesh, so it’s not like i get unique UV’s for each face after the merge. Did that last part make sense or?

---

<div class="post-metadata">

**Author:** ![RyanB](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyanB](https://forums.unrealengine.com/u/RyanB)\
**Post date:** [September 22, 2016, 6:52pm UTC](https://forums.unrealengine.com/t/sprite-model-how-did-they-do-this/2968/24 "2016-09-22T18:52:58Z")

</div>

Yes I had the same problem where each segment has the same UVs.

To paint the solid color you just do “paint vertices solid color” (name may not be exact but my editor is stuck saving a huge map atm). You would need to know how far the current parent segment is going to get, and then track the local iteration within the branch. Then you just divide the 2nd number by the 1st, do 1-x and use that on the paint node.

Then you can reference the vertex color node in the materials and use that to multiply the width values. you could also do power etc on the color to make it non linear.

---

<div class="post-metadata">

**Author:** ![Jonas\_Molgaard](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jonas\_Molgaard](https://forums.unrealengine.com/u/Jonas_Molgaard)\
**Post date:** [September 22, 2016, 7:58pm UTC](https://forums.unrealengine.com/t/sprite-model-how-did-they-do-this/2968/25 "2016-09-22T19:58:20Z")

</div>

Ah i see the idea yes. But won’t this create some substepping, since im painting with a solid color? (Paint Verticies Single Color) Anyway, im gonna try it out and see how far i can go with this.

Doh! So using Paint Verticies Lerp Along Axis as you said, allows me to set a start and end color yes, and even the Axis. Think i can work this out 🙂

---

<div class="post-metadata">

**Author:** ![Jonas\_Molgaard](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jonas\_Molgaard](https://forums.unrealengine.com/u/Jonas_Molgaard)\
**Post date:** [September 22, 2016, 10:16pm UTC](https://forums.unrealengine.com/t/sprite-model-how-did-they-do-this/2968/26 "2016-09-22T22:16:21Z")

</div>

Yay, i got it to work. Thanks again Ryan for all the patience with me. I ended up doing excactly as you said in one of the first posts, to use the “paint vertices lerp along axis”. Just had to read a bit up on vertex painting.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/7/777286eed0c4f37dcc9fce934329b8946dc4f8a3.jpeg "Quick look at Spline thicken") ](https://www.youtube.com/watch?v=2w44UH5tvOg)

Im gonna talk about this on one of my upcoming videos and share what i have learned today.

---

<div class="post-metadata">

**Author:** ![JonathanCDev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JonathanCDev](https://forums.unrealengine.com/u/JonathanCDev)\
**Post date:** [June 4, 2018, 12:41am UTC](https://forums.unrealengine.com/t/sprite-model-how-did-they-do-this/2968/27 "2018-06-04T00:41:06Z")

</div>

How can i get it to Align with the next Mesh? @RyanB when i start to move around it doesnt match anymore

---

<div class="post-metadata">

**Author:** ![JonathanCDev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JonathanCDev](https://forums.unrealengine.com/u/JonathanCDev)\
**Post date:** [October 7, 2018, 5:30pm UTC](https://forums.unrealengine.com/t/sprite-model-how-did-they-do-this/2968/28 "2018-10-07T17:30:27Z")

</div>

> [@RyanB](#):
>
> Sure thing. I just wrote up a more detailed doc for a contractor so I have all the images. This probably has more info than you need.
> 
> The basic idea behind spline thicken is that it is like a camera facing sprite that follows a path. The “path” is basically just a pre made row of thin hair like polygons. The vertex shader then extends these polygons in a direction that is always perpendicular to the camera direction so the mesh always appears to be of the same thickness when viewed from any direction.Here is a quick example I made using 3dsmax.
> 
> First I draw a line with a bent pipe shape. Then go to settings for the line and check both “enable in renderer” and “enable in viewport” and “Generate Mapping Coords”. Set sides to 4 since unfortunately that is the minimum and set angle to 45 so we can more easily delete the extra faces.
> 
> ![SplineThicken_01.JPG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/4/0/4003bb59638d90e8c60291c36bf449a3504582a1.jpeg)
> 
> Next convert to editable poly and select and delete all but one strip of faces (this step is only necessary when using the line tool and can usually be removed from modelling workflow by other means)
> 
> ![SplineThicken_02.JPG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/2/d25482068afba609a26c97507d3d0596b0460a6e.jpeg)
> 
> The simplest method is to make the polys very thin, but you can also leave them at a specified thickness and then de-project in the material in UE4 in order to get better static lighting support but that shouldn’t be necessary for this project:
> 
> ![d1520d51cc4d267065c5a59b860c40f7ba058faa.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)
> 
> Finally you want to give each polygon 0-1 UVs by adding an UnwrapUVW modifier and stretching the UVs horizontally to fit 0-1. You can also adjust the Y to be uniform or just adjust it in the material later.
> 
> ![c4480b5d3852afd37d5f59c12842b82965c974de.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)
> 
> In addition to checking 2-sided also make sure to uncheck “tangent space normal” on the material (the need for 2 sided is just a bug, I believe tangent direction flipped since this function was made. you can also use negative width params but that will flip the normals):
> 
> ![3c32e7a29cf28f73eafd255dfc354fc47f37934c.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)
> 
> For the material, if you are using the default projection along tangent U, you shouldn’t have to do anything besides this:
> 
> ![db3fe3fff8392bd50371ef05ad2b029f235e11be.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)
> 
> If you set it up right, it should match actual geometry almost perfectly, when the viewing angle is not parallel with the spline which causes artifacts:
> 
> [http://i.giphy.com/26ufj5vHAlpMvU9kk.gif](http://i.giphy.com/26ufj5vHAlpMvU9kk.gif)
> 
> You can do tons of cool things with spline thicken. Here is a prototype stony coral I made using a really quick crappy material:
> 
> [http://i.giphy.com/26uf85plXD5rLy82A.gif](http://i.giphy.com/26uf85plXD5rLy82A.gif)
> 
> This smaller one shows the wireframe:
> 
> [http://i.giphy.com/l2SqiFBs21o8Bhfeo.gif](http://i.giphy.com/l2SqiFBs21o8Bhfeo.gif)
> 
> And yes, all of this has been passed on to the docs team but I am not sure when they can get to adding it.
> 
> Re: your specific questions in the images:
> 
> The “Expand U or V” option allows you to expand the spline either along the UV.X or the UV.Y channel. The example above uses the X channel and I suggest sticking to that and leaving it alone.
> 
> WorldPosition input is only for very specific effects, such as when you want to apply other offsets to the spline before thickening. 99% of cases don’t need to hook anything to WorldPosition input. Certainly don’t put cameraposition there.
> 
> The “Width Base” and tip are how wide it projects the verts from the spline in world units. It will use the opposite of the proection axis in the UVs to blend between the two values. So for the default option where it projects using U (UV.x), it will use UV.Y to fade between width base and tip.

would this even work if i did it in blender? been trying and cant get it to work.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_39d66640](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_39d66640](https://forums.unrealengine.com/u/anonymous_user_39d66640)\
**Post date:** [April 26, 2019, 11:13pm UTC](https://forums.unrealengine.com/t/sprite-model-how-did-they-do-this/2968/29 "2019-04-26T23:13:27Z")

</div>

Should be no reason why this wouldn’t work. So long as Blender allows you to model thin meshes and create a UV set, then you should be set.

would this even work if i did it in blender? been trying and cant get it to work.  
[/QUOTE]

---

<div class="post-metadata">

**Author:** ![muchcharles](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@muchcharles](https://forums.unrealengine.com/u/muchcharles)\
**Post date:** [June 23, 2020, 4:02am UTC](https://forums.unrealengine.com/t/sprite-model-how-did-they-do-this/2968/30 "2020-06-23T04:02:25Z")

</div>

> [@RyanB](#):
>
> (the need for 2 sided is just a bug, I believe tangent direction flipped since this function was made. you can also use negative width params but that will flip the normals)

Anyone have ideas on how to fix the bug? Doesn’t two-sided double the triangle count? Is it just something like if normal faces away from camera, need to shift it along tangent direction to flip with the opposing vertex?

---

<div class="post-metadata">

**Author:** ![muchcharles](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@muchcharles](https://forums.unrealengine.com/u/muchcharles)\
**Post date:** [June 23, 2020, 4:13am UTC](https://forums.unrealengine.com/t/sprite-model-how-did-they-do-this/2968/31 "2020-06-23T04:13:40Z")

</div>

would this even work if i did it in blender? been trying and cant get it to work.  
[/QUOTE]

Add a curve and then set extrusion under the curve panel (0.00001 did about a millimeter of extrusion for me, I’m not sure why it had to be entered as 10 microns; double check that it doesn’t get too tiny or you might run into precision errors). Select the curve, hit f3 and search for ‘convert to’ and convert to mesh. It will generate a quad strip that works, except the UV is extruded along V instead of U (you can just rotate it 90 degrees, or set the bool on the thicken node to expand along V instead of U). Make sure when you import into ue4 you uncheck remove degenerates.

 ![SplineThickenTriangleStripBlender.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/2/4/24b3556b0f63f05edc3814a1e8d4b7200681f939.png)

---

<div class="post-metadata">

**Author:** ![frogspasm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@frogspasm](https://forums.unrealengine.com/u/frogspasm)\
**Post date:** [July 24, 2020, 10:55pm UTC](https://forums.unrealengine.com/t/sprite-model-how-did-they-do-this/2968/32 "2020-07-24T22:55:31Z")

</div>

Would there be a way to get this to work with Ribbons?  
I assume you would have to make them not camera facing, and somehow make it work along the X axis rather than the Y.

[Previous page](https://forums.unrealengine.com/t/sprite-model-how-did-they-do-this/2968.md?page=1)
