How to integrate an animation created using Blender into RTB?

Discussion in 'General Discussions' started by Lakshmi, Nov 12, 2019.

  1. Lakshmi

    Lakshmi New Member

    Joined:
    Oct 8, 2019
    Messages:
    20
    Likes Received:
    3
    dryfountainimage.jpg Hi,

    I am new to 3D modeling and have started to learn using RTB and Blender. As a part of my project, I have to create a dry fountain ( pic 1). So I have chosen Blender and created a fountain animation as shown in the pic(2& 3). And now I am trying to find if there is any possibility at all to export the animation from Blender into RTB and make it work?

    Any suggestions on how it can be done.

    I tried to upload a small animation of the generated fountain here but didn't work.

    Thank you! View attachment 4042 View attachment 4042 Screenshot (936).png FOUNTAIN.png
     
  2. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    Sry, in AC no support for animations for track-objects other than baloons (with models.ini)
    and therefore also not in RTB.
     
  3. MGMetroDave

    MGMetroDave Active Member

    Joined:
    Apr 7, 2019
    Messages:
    141
    Likes Received:
    159
    Hi @Lakshmi , yes, as @fughettaboutit said, not really any support for much in the way of animations within AC. I did do a brief post here about animation possibilities currently offered in AC, but there isn't much else.

    https://assettocorsamods.net/threads/phoenix-1989-1991-f1-street-circuit.1650/page-12#post-12621

    There is 1 other option I'm aware of, which is what I did here for a campfire animation (chck near the end of the youtube video in this post):

    https://assettocorsamods.net/threads/disabling-wind-effect-on-meshes-shaders-patch.1791/#post-12830

    If you read that thread it has a download for the finished fire. It's effectively a very short looped video animation, with an alpha channel for transparency. The stFlow shader (available here: https://www.racedepartment.com/downloads/stflow-shader.23999/ allows for this possibility since you can make a texture with all the frames of your animation side-by-side then use stflow to animate them at a speed of your choice. Just set the 'y' (2nd) pause timing value to -1 otherwise the texture will scroll).

    You could potentially do something similar by rendering your fountain somehow into a looped video in blender (sorry I don't know how), then outputting it. Since it's water you could possibly also render your video out as a normal map. stFlow allows for animating normal maps. Bear in mind that stFlow requires your transparency alpha channel to be on the normal map rather than the diffuse texture.

    Hope this helps a little
     
  4. Lakshmi

    Lakshmi New Member

    Joined:
    Oct 8, 2019
    Messages:
    20
    Likes Received:
    3
    Thank you for the info!
     
  5. Lakshmi

    Lakshmi New Member

    Joined:
    Oct 8, 2019
    Messages:
    20
    Likes Received:
    3
     
    Last edited: Nov 14, 2019
  6. Lakshmi

    Lakshmi New Member

    Joined:
    Oct 8, 2019
    Messages:
    20
    Likes Received:
    3
     
  7. MGMetroDave

    MGMetroDave Active Member

    Joined:
    Apr 7, 2019
    Messages:
    141
    Likes Received:
    159
    Hi Lakshmi, sorry I completely missed that you were doing it in RTB. My mistake. Unfortunately I'm not at all familiar with RTB or what it's capable of or not. What I described was using 3D Modelling software(in my case Blender 2.79) then exporting as FBX format then loading it into kseditor, a.k.a. Assetto Corsa SDK, adjusting shader and object settings in that, then exporting to the finished KN5 for use in AC.

    Creating everything in blender or another modelling software of your choice will probably give you the most flexibility in the end.

    Sorry again I have no experience with RTB.

    If you wanted to only use the blender to kseditor method for the fountain, you could probably create it in blender, making sure the object was close to the 0,0,0 origin. Also make sure rotation and scale have been applied, then export to FBX, setting the scaling to FBX unit scaling in the export dialog. Then load it in kseditor, set it to stFlow shader, adjust settings as you see fit, then export to KN5 and put it in your track's folder with your other kn5s.

    Next, make a models.ini text file in the same folder. You can copy one from another track and edit it to make sure it's in the right format. You'll notice you can position each KN5 file manually if need be using X,y and z coordinates. If you know the coordinates of where you want the animation, you can type then in there. Otherwise you can use the shaders patch debug app in game to tell you the coordinates.

    https://www.racedepartment.com/downloads/custom-shaders-patch-debug-app-advanced.29060/

    Hope this helps.:)
     
  8. Lakshmi

    Lakshmi New Member

    Joined:
    Oct 8, 2019
    Messages:
    20
    Likes Received:
    3
    thank you once again for your time for such a detailed summary☺. Since I am a beginner I find it a bit complicated. But for sure I am going to follow the procedure mentioned by you and maybe I will come back again with many questions [​IMG] .
    I have a very basic question:: install or unpack to AC root means, to relocate the folder to AC path right or directly into AC or Ks editor folder?
     
  9. MGMetroDave

    MGMetroDave Active Member

    Joined:
    Apr 7, 2019
    Messages:
    141
    Likes Received:
    159
    Hi Lakshmi. No problem! I've still got very much to learn myself! I don't know your skill level but if you are as you said 'a beginner', you may find it easier to work on a smaller, more basic track first and then learn some of these other things later, since the stuff I described isn't particularly beginner-friendly. Not doubting that you'll be able to do it, just don't judge AC modding based on how hard and time consuming it is to make an animation! :lol:

    Unpack into AC root means just to find where Assetto Corsa is installed on your PC, e.g. c:\program files (x86)\Steam\steamapps\common\assettocorsa\ then unzip/unpack the archive file there.

    Best wishes with your modding!
     
  10. Lakshmi

    Lakshmi New Member

    Joined:
    Oct 8, 2019
    Messages:
    20
    Likes Received:
    3
    Yeah. You are right! In my case, I used RTB to build a track and Blender to create the animation. So like you said at the moment I am not familiarised with many of the things.

    and thank you for your quick response :)
     
    MGMetroDave likes this.
  11. Lakshmi

    Lakshmi New Member

    Joined:
    Oct 8, 2019
    Messages:
    20
    Likes Received:
    3

    Hi @MGMetroDave,

    I am using Blender 2.8 to create the fountain. As mentioned above I set the origin, applied rotation and scale and then imported the fbx into kseditor. Unfortunately, I don't find either the loaded file or the stFlow shader ( Unpacked into AC root).

    I couldn't upload the file (blender or fbx) here to test.

    Can you probably help me to find where the mistake would have been?

    Thank you!
     
  12. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    open the archive, dont just unpack, then copy those two selected folders from the left to assetto folder
    upload_2019-11-18_10-22-40.png
    then you will find it here (best to keep ksEditor in "assettocorsa\sdk\editor")
    upload_2019-11-18_10-25-36.png
     
    Last edited: Nov 18, 2019
  13. MGMetroDave

    MGMetroDave Active Member

    Joined:
    Apr 7, 2019
    Messages:
    141
    Likes Received:
    159
    @fughettaboutit Thank you for the screenshots!

    @Lakshmi Also, if you still can't find stPerPixelNM_UVFlow in the shaders, maybe check exactly where you have the AC Editor installed to. You might have AC Editor (kseditor) installed to a different folder than the main AC folder, e.g. something like ....Steam\steamapps\common\Assetto Corsa Editor\ . If that's the case, try unpacking the stflow archive there too.

    You should end up with a file called "stPerPixelNM_UVflow.shader" in Steam\steamapps\common\(install folder e.g. Assetto Corsa Editor)\system\shaders, and inside that folder there should be another folder called 'win' with 'stPerPixelNM_UVflow_meta.ini', 'stPerPixelNM_UVflow_ps.fxo' and 'stPerPixelNM_UVflow_vs.fxo' in it.
     
  14. Lakshmi

    Lakshmi New Member

    Joined:
    Oct 8, 2019
    Messages:
    20
    Likes Received:
    3
    view in kseditor Screenshot (938).png hi @fughettaboutit,

    thanks for your response.

    ok, then I see that the files(sdk& system) were installed long time ago in AC folder. Thou I cannot see the shader highlighted in kseditor.

    And this is how my fountain looks in kseditor

    this image is from Blender window
    Screenshot (942).png
     
  15. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    open the archive, dont just unpack, then copy those two selected folders from the left to assetto folder

    it has more folders underneath, sdk and system folder are always there in AC dir
     
  16. Lakshmi

    Lakshmi New Member

    Joined:
    Oct 8, 2019
    Messages:
    20
    Likes Received:
    3
    @fughettaboutit @MGMetroDave

    thank you again.

    it worked. I have unpacked the stflow archive in kseditor folder too. Now it is shown in kseditor.

    And as you can that is the fountain created in blender. Screenshot (944).png

    image from blender. I haven't applied any texture to the objects other than material->Glass BDF.

    Could that be a reason the image is shown so unusual?

    Screenshot (942).png

    how to upload fbx animation (from Blender 2.8) into kseditor. The image shown above is just an image.
     
    Last edited: Nov 18, 2019
  17. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
  18. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    ok the video is not very enlightening
     
  19. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    these are my textures from above
    diffuse "rgba020509ff.dds" is 32x32 a small darkblue solid color, alpha channel slightly dark (223,223,223)

    upload_2019-11-18_11-17-43.png
     

    Attached Files:

  20. MGMetroDave

    MGMetroDave Active Member

    Joined:
    Apr 7, 2019
    Messages:
    141
    Likes Received:
    159
    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.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice