Hi @alex.underhillI made a small video about using slate to make optical flow textures with slate for unreal. Some questions popped up while doing this. If you want, I would be happy to see what my mistakes are.
Hey Simon, I just watched this, thank you so much again! I have taken notes on all your points I can act on. It was great to see you use it and see what the pain points were. I have been working on updating the timeline widget as well which seems like the bit thatās really letting it down.
Let me address some of your points.
Timeline playback
Very embarrassing and I will resolve this with a timeline widget update. You can change playback speed here
It looks like in your UI, the default means you have to scroll to see it but with no hints to do so. Not really a good start on my end!!
Strong values being packed in to first/last frames as default:
This is actually intentional, however maybe the defaults should be to leave blank. What Slateās actually doing, is by default, looping through your texture sheet. So at the last frame, it considers the neighbouring texture to be the first of your sequence. And at the first frame, it references the last frame. For things like a one shot effect, the start/end of your sequence is quite different hence the super strong values. For looping animations, the values should help naturally flow from end to start and back again. Hope that helps.
Changing your numbers for Unreal
The āCurrent Minimum/Current Maximumā readouts are there to show how far the optical flow process has had to search for motion (in pixels) on the entire sequence. So a value of -10.0, 10.0, normally shows that itās had to search 10px either direction to calculate motion. Normally that value doesnāt have much use for shaders as itās in raw pixel space rather than UV space. Instead, you can dial it in to your āDistance Limitā field for the next time you generate. This will ensure you get a nice range of data in your image, rather than clipped white/black values where the data range is clipping.
The actual shader numbers
This is pretty tricky territory. From your video you mentioned itād be good to know what the preview is using? The good news is, I made all the shader files I use for Slate entirely public, and are visible in the /ProgramFolder/Assets/Shaders/ folder.
The asset youāll want to inspect is Shaders/UI/AnimationPlayback.glsl
Itās quite a messy shader (sorry!) as it has to do every type of animation playback but the key is, all Iām doing is using the uFlowStrength uniform, which is just the Shader Estimate values that are shown in the UI.
Iām not completely familiar with Unrealās shipping motion vector shader, I think it came a little after I released Slate initially so the two may not play nicely together.
I threw up a shader on Github for using optical flow from Slate.
With this setup, the main thing I seem to do differently, is setting my Optical flow textures to āNormal Mapsā to take advantage of unpacking the data to -1.0, 1.0 automatically.
Iāve just noticed that this set up tends to want the magic number from Slate, to be multiplied by 2 for better results. I imagine this is due to the texture data being expanded from 0.0-1.0 to -1.0,1.0, which would mean an increase of a factor of 2. I will fix this from Slateās side for the next update.
Sorry for the long read. Hopefully that answers some of the questions and once again, a massive thank you for this as it has really helped me focus on some things I should resolve.
Thank you so much for the answer, super useful! Iāve added a link to this answer to the Youtube description so that others can read it. Now everything i way clearer Thank you for spending so much time giving us such a great tool!
Hi @alex.underhill , It might be a dumb question but can we save outputs as individual images, instead of flipbook format? I read through the menu but couldnāt find an option. Thanks!!
Hi!
Yes, sorry I have done such a bad job with the doc stuff but it is possible to do this.
You will want to open the āLayer Settingsā panel and drill down to the layer you want to export (ie full color, optical flow, shader pass etc)
You can configure out the file path here too. It will use the render settings (ie file type) and root path your project is using in RenderingSettings/Output, so I normally have /Frames/ as a prefix for my tile file name and a _$F which is the current index that this frame is in your sheet.
On export, it will load up the full resolution assets even if the preview is low res.
Hey @alex.underhill, thanks so much for the reply!
Iām glad to know there is an option for individual export.
I followed your set up but somehow my individual OF renders gray. It OF renders fine when itās exported as a flipbook sheet though. I tried all blend mode to test, but they are all grey, and image renders to be 170 x 102 pixel size. I only have ādefaultā image sequence option instead of āDecemberā, could that be an issue?
Thanks!
Hey,
so is it calculating the flow fine, its just when it exports as individual files it will be grey?
Yes, It exports OF as grey image when exported as individual files. Default(diffuse) also exports as black image when exported as individual files.
Both exports fine when exported as tile sheet.
Thanks!
hey gang!
just curious if Slate was abandoned? Iām trying the recent version and noticed that the documentation links donāt work and there are inconsistencies with whatās on the webpage and whatās includedā¦ ie: the recoloring shader.
I really hope not, as this is a great tool!
Hey, yeah thats my bad as Iām really bad at docs.
Definitely not abandoned - I have been working on a rewrite for some time now to make things much friendlier. Unfortunately it takes a lot longer than I was hoping. If theres ever anything I can help with just shoot me a msg though and Iāll be happy to help
If this is the wrong place to post this I am very sorryā¦ So I am using slate Editor additive materialsā¦I am getting some banding see photos please. any thoughts?
Hi, Iām recently using Slate editor, I have a problem, after I use devolved tool to split spritesheet into single images everything is fine but after I want to import the texture form file they will randomize and itās really a mess, I canāt to organize them manually, so what should I do?!
after devolving (in Explorer)
after importing (in Slate Editor)
Hopefully this oneās a straightforward fix:
Once youāve got an image sequence in the content browser, double click it to edit and you should find the Sort Files drop down, try changing it to either Numerical Asc(ending) or Last Edit. Let me know if none of them do the trick for you.
Thank you, it works. I havenāt try this method.
Hello,
This is probably a stupid issue but when I import my image sequence of 512px images Slate always sets them to 128px and I canāt find a way to get the original resolution. Am I missing something?
Double check that itās not just the preview resolution. It could also be the size of you flipbook in your settings that is lowering the resolution of your individual frames. If your total resolution is something like 1024x1024 and youāre importing enough frames for a 8x8 flipbook, it may be trying to fit 8 images into a 1024 max resolution and shrinks them down to accommodate that size
hi Alex!
Thanks for the reply. SUPER sorry i never replied back. i donāt come here nearly often enough and just noticed that i dont get notifications.
I hope this is an easy problem to solve - Iām importing a sequence of EXRs that are 32bpc. The problem im having though, is that when save out my subUV texture, it clamps the RGB values in 0-1. is there some way i can retain their values so they donāt lose colour information / the HDRity ā¢ ?
cheers!
Hi, guys. I encountered a problem with optical flow. I have my sequence and in preview it looks fine, but optical flow layer is always empty. All settings is default, source image is jpg
Well, it somehow fixed itself after reinstalling windows. Extreme measure, but needed to do it for a long time anyway.