• Dear visitors,

    The email issue has been finally solved.
    Thank you for your patience and happy browsing.

    Team ACM.

How to integrate an animation created using Blender into RTB?

Lakshmi

New Member
Not sure exactly how you've created your files, so forgive me if this doesn't work, but assuming you've rendered out a short animation from blender, as a 2D sprite, then put the rendered images side-by-side and saved as a texture.

Feel free to take a look at my fire file for example and settings here too https://assettocorsamods.net/threads/disabling-wind-effect-on-meshes-shaders-patch.1791/#post-12837 .

If you're doing your animation like mine, then the crucial things are:
1. Make the animation mesh use only 1 'frame' of your animation texture. In other words, if your animation 'frame' size is 64px X 64px, and you had 32 frames in the animation loop, your texture needs to be (32 x 64 =)2048px wide x 64px high. So in this case you'd make a square mesh in blender and map the it to a 64x64px section of your image texture.
2. If you want transparency, the transparency mask needs to be the alpha channel of the NM texture. If not, or if you don't have one yet, skip this step. In other words, if you're able to, render out or create a mask in the same manner that you did the main animation, with black = transparent and 1 = fully opaque. Then make a 'blank' NM file (the main colour of the whole image texture should be exactly hex code #8080FF (half red, half green, full blue). Give it an alpha channel and copy your mask to it. Save this as your NM DDS texture. (again, take a look at my file for example)
(Not sure exactly how it should look for your water fountain, but you can experiment. Perhaps you could even render out a real normal map from your blender animation too??)
3. In kseditor, switch the shader for that mesh to stPerPixelNM_UVFlow
4. Set your txNormal to your masked normal map texture file or if you don't have one, set it to NULL.dds, which is automatically created along with your other textures I think. Set your txDetailNM to NULL.dds.
3. Apply settings (look at mine as an example). stFlow is designed for scrolling textures, but can also be used to increment the whole texture by a specific amount e.g. 1/64th ever specific amount of time. Hence you'll notice the 'pauseTiming' is set to "0.015625,-1", which simply means increment 1/64th of the image (1 / 64=0.015625) and the -1 tells the shader to increment instead of scroll.
4. Set the speed of the animation of both the diffuse and Normal Map, e.g. offsetDSpeed=1,0 offsetNMSpeed=1,0 (you can play with these settings to affect the speed of the animation)
5. Play with the ambient and diffuse properties as you would with any other shader.
thank you for the detailed explanation. I am gonna apply this.
 

Lakshmi

New Member
Not sure exactly how you've created your files, so forgive me if this doesn't work, but assuming you've rendered out a short animation from blender, as a 2D sprite, then put the rendered images side-by-side and saved as a texture.

Feel free to take a look at my fire file for example and settings here too https://assettocorsamods.net/threads/disabling-wind-effect-on-meshes-shaders-patch.1791/#post-12837 .

If you're doing your animation like mine, then the crucial things are:
1. Make the animation mesh use only 1 'frame' of your animation texture. In other words, if your animation 'frame' size is 64px X 64px, and you had 32 frames in the animation loop, your texture needs to be (32 x 64 =)2048px wide x 64px high. So in this case you'd make a square mesh in blender and map the it to a 64x64px section of your image texture.
2. If you want transparency, the transparency mask needs to be the alpha channel of the NM texture. If not, or if you don't have one yet, skip this step. In other words, if you're able to, render out or create a mask in the same manner that you did the main animation, with black = transparent and 1 = fully opaque. Then make a 'blank' NM file (the main colour of the whole image texture should be exactly hex code #8080FF (half red, half green, full blue). Give it an alpha channel and copy your mask to it. Save this as your NM DDS texture. (again, take a look at my file for example)
(Not sure exactly how it should look for your water fountain, but you can experiment. Perhaps you could even render out a real normal map from your blender animation too??)
3. In kseditor, switch the shader for that mesh to stPerPixelNM_UVFlow
4. Set your txNormal to your masked normal map texture file or if you don't have one, set it to NULL.dds, which is automatically created along with your other textures I think. Set your txDetailNM to NULL.dds.
3. Apply settings (look at mine as an example). stFlow is designed for scrolling textures, but can also be used to increment the whole texture by a specific amount e.g. 1/64th ever specific amount of time. Hence you'll notice the 'pauseTiming' is set to "0.015625,-1", which simply means increment 1/64th of the image (1 / 64=0.015625) and the -1 tells the shader to increment instead of scroll.
4. Set the speed of the animation of both the diffuse and Normal Map, e.g. offsetDSpeed=1,0 offsetNMSpeed=1,0 (you can play with these settings to affect the speed of the animation)
5. Play with the ambient and diffuse properties as you would with any other shader.
hi again,

I tried but didn't worked.. I have no idea how to save all rendered images (100 in my case) into a single texture, is it by compositing or how can that be done?
 

MGMetroDave

Active Member
I used a program called Image Magick (https://imagemagick.org) which allows you to use the command line to append multiple images side-by-side.

I think I used the command (for example):

convert +append in-*.tif out.tif

...which will add any images with filenames starting "in-" side by side and save them as out.tif . Don't quote me if that's not perfectly correct. I hadn't used it before nor have I used it since. You could also do it manually in photoshop or gimp if you prefer of course
 

Lakshmi

New Member
I used a program called Image Magick (https://imagemagick.org) which allows you to use the command line to append multiple images side-by-side.

I think I used the command (for example):

convert +append in-*.tif out.tif

...which will add any images with filenames starting "in-" side by side and save them as out.tif . Don't quote me if that's not perfectly correct. I hadn't used it before nor have I used it since. You could also do it manually in photoshop or gimp if you prefer of course
okay, thank you. I will try it.
 

Lakshmi

New Member
Hi again,

@MGMetroDave

I applied the method as explained above.

created the render images, aligned side by side and converted to dds and nm_dds( using GIMP Editor).
Test 64 Bilder.png


Uploaded all the files into kseditor.

This is how my animation is shown in kseditor.
Screenshot (952).png


It is just showing the last image where I have exported the FBX file.
Screenshot (951).png

Screenshot (950).png


Unfortunately, there is no animation.
I don't know what went wrong. Can anyone help me with this?

Thank you in advance!!
 

fughettaboutit

aka leBluem
try changing this too: offsetNMdetailSpeed , but maybe you did
and did you UV map it in Blender?

also maybe its just too bright to see anything, dont use so much ksEmissive, maybe not at all

rather use something like this, as default values are stupid sometimes
ksAmbient=0.4
ksDiffuse=0.4
ksSpecular=0.05
ksSpecularEXP=20
 
Last edited:

MGMetroDave

Active Member
Yes sorry the ksEmissive values on mine were only there because the fire is self-illuminating so you'll probably want to set that to 0 0 0.
I can't honestly see anything wrong with what you've done there. It looks right to me. Did you say that you've got 100 frames? In that case you'll probably want to set pauseTiming to “0.01 -1” but that shouldn't be stopping it working completely.

Hmmm
 

MGMetroDave

Active Member
I just realised I made a mistake. You can't use NULL.dds for the txdetailNM. Instead you need to create a tiny (e.g. 4 px X 4 px) texture with the exact hex colour #8080FF (neutral colour for normal maps) and save that as a DDS and use that. Sorry for the confusion!
 
Last edited:

Lakshmi

New Member
hi @MGMetroDave

I tried all the possibilities.

But, I didn't do UV mapping (I will do it), do you think that could be the reason for the animation not to work?

Thank you!!
 

MGMetroDave

Active Member
Hi @Lakshmi . It's strange that it's not working. At a glance from the it looks like you've UV mapped it correctly already. Feel free to send me the files via private message if you like and I'll take a look. I promise not to share the files with anyone.
 

Lakshmi

New Member
try changing this too: offsetNMdetailSpeed , but maybe you did
and did you UV map it in Blender?

also maybe its just too bright to see anything, dont use so much ksEmissive, maybe not at all

rather use something like this, as default values are stupid sometimes
ksAmbient=0.4
ksDiffuse=0.4
ksSpecular=0.05
ksSpecularEXP=20
I tried but it didn't work either.
 

Lakshmi

New Member
Hi @Lakshmi . It's strange that it's not working. At a glance from the it looks like you've UV mapped it correctly already. Feel free to send me the files via private message if you like and I'll take a look. I promise not to share the files with anyone.
yeah sure.

But where do I find the option to send you files via private message?
 

Lakshmi

New Member
Hi again,

I have no idea where am I doing wrong.

As fughettaboutit said, I did UV map and then rendered the animation into images (30, aligned side by side) and loaded into Kseditor. But still, facing the same issue. No animation is working. It shows the last image where it is exported to FBX format. It just scrolls the data contained in diffuse and normal dds files(images aligned side by side).

It could be an easy step but, unfortunately, I got stuck at this point.

UV Map editing and adding texture to the fountain and saved or is there any other method to do that?
Screenshot (960).png

rendered image
Onefountain_allimages.png


imported to kseditor

Screenshot (961).png


Can anyone help me where could be the mistake?
 
Last edited:

MGMetroDave

Active Member
Hi @Lakshmi . Sorry for not getting back to you sooner. I've not been well and finding it very hard to process things mentally. Brain not working properly :lol:, so I'm sorry in advance if I can't help you with this.

Perhaps I didn't explain the way the shader works properly. There are essentially 2 ways to use the stFlow shader. In both cases all that's really happening is that a texture is scrolling along a mesh, and that there's never any real 3D mesh animation. No vertices/triangles/meshes can ever change their location in the 3D world, so any 'animation' we do is really a workaround based on this limitation.

So stFlow can essentially be used in 2 ways:

1. Create a plane and scroll the texture smoothly along it, either along the X or Y axis (of the texture, not the 3d mesh).

2. Create a plane and instead of scrolling the texture along it, make it jump (increment) a specified amount of the texture every specified amount of time. This basically gives the animated effect because every time the texture jumps it jumps to the next frame of the animation. In this way, we give the illusion of there being an animation there, but all it's really doing is moving the texture along a certain number of pixels at a time, but jumping to that point rather than moving to it smoothly. To use this method (method 2) the pauseTiming's second value is set to -1 to tell the shader to use this mode.

To get my fire animated I just used method 2 then wrapped the animation around the edges of an open-ended cylinder, if I remember correctly.

Hopefully the above info gives a little clarity to how it's used, even if it doesn't tell you specifically what to do in your case.
 

Lakshmi

New Member
Hi @MGMetroDave, thank you for the time and your detail explanation. I wish you to get well soon!

I understand that there is a lot I should know about the shaders and how do they work. I will try this out.

Thank you for sharing the information.
 

quetillo

Member
[QUOTE = "fughettaboutit, post: 12958, member: 47"] estas son mis texturas de arriba
"rgba020509ff.dds" difuso es de 32x32 un color sólido azul oscuro pequeño, canal alfa ligeramente oscuro (223,223,223)

[ADJUNTE = completo] 4095 [/ ADJUNTE] [/ QUOTE]
donde puedo conseguir esas texturas de agua
 
Top