How did I do it?
First I created a texture of paper using GIMP. To do this I created an A4 size canvas used the "RGB Noise" in filters to make it very noisy, I then turned the noise to grayscale and added motion blur to give the paper some texture.
I then scaled it down to 2048x2048 which squashed it but because of how we will set up the UV it doesn't matter. In fact it's more efficient this way because it allows unreal to create mipmaps for us automatically, saving time, making the game faster and it's less assets for us to track. I also exported it as portable network graphics (PNG) so that we don't get any artifacts that we might get if we were to export it as a jpg.
Next we setup the model for this i used blender. all we do is get a cube, stretch it to the size of A4 paper and then make it very thin - not too thin because if the vertices are too close together then unreal complains.
I also made a material and added the paper texture we just made. We export this now as a FBX, making sure that it is in the center of the grid.
Now in unreal we import all the assets we just created and make sure that the material is correctly assigned and properly rendered. Next we create a use widget. This is what we will use to render the dynamic text to the paper, in the widget we have a multi-line editable text box set as read only - we use this because the regular one can't have more than one line of text. We also use a scalebox so that the text can be scaled and a sizebox so that we can resize the area of where the text will be on the paper.
After that is set up we then remove the background so that is transparent. Next we setup the blueprints (diagram will be at the bottom of this post), first off we change the style of the tex, we set the width and height and text.
We then create an actor called "Base_Paper" this will have all the necessary blueprints and we use child blueprints for each different paper we have. For the actor itself it has a static mesh component with the paper mesh set, we also set it as the root and have 2 widget components sandwiched either side of the paper mesh.
For the actor's blueprints we have an array of the front and back components (easier to loop blueprints) and another array of 2 texts which will be text on both sides. in the loop we create a widget, add it to an array (so we can keep track on them) and set the widget component to that.

No comments:
Post a Comment