powerspeed_de Posted December 19, 2011 Share Posted December 19, 2011 how to make an animated map of the diffuse material to mesh_base? how to use video or image sequence for static or skined mesh? Link to comment
ulf.schroeter Posted December 20, 2011 Share Posted December 20, 2011 Read the documentation: there is no mesh_material/mesh_skinned_material with video support. Video playback is only supported by WidgetSpriteVideo GUI element. There is also a UNIGINE sample for draping GUI on a mesh, maybe these 2 elements can be used somehow for achieving your desired effect. Otherwise I think you will have to implement it on your own with WidgetSpriteVideo as a blueprint (assuming you have source code access) Link to comment
powerspeed_de Posted December 20, 2011 Author Share Posted December 20, 2011 it's complicated, it would be easier if we could have a sequence of images ((( Link to comment
ulf.schroeter Posted December 20, 2011 Share Posted December 20, 2011 Than create a new mesh material with 3D texture support for storing multiple diffuse (normal,specular) texure "slices" and a new parameter for texture slice selection. Of course a 3D texture will can only support a limited number of slices due to high memory consumption. Link to comment
frustum Posted December 20, 2011 Share Posted December 20, 2011 Create 2d atlas of frames. You can pack 256 different frames with 256x256 size in the single 4096x4096 texture. And set texture transformation which will switch frames: { int f = int(engine.game.getTime() * 4.0f); return vec4(1.0f/16.0f,1.0f/16.0f,(f%16)/16.0f,(f/16)/16.0f); } 1 Link to comment
powerspeed_de Posted December 20, 2011 Author Share Posted December 20, 2011 oh! that's interesting, thanks, will try to Link to comment
danni.coy Posted January 10, 2012 Share Posted January 10, 2012 Create 2d atlas of frames. You can pack 256 different frames with 256x256 size in the single 4096x4096 texture. And set texture transformation which will switch frames: { int f = int(engine.game.getTime() * 4.0f); return vec4(1.0f/16.0f,1.0f/16.0f,(f%16)/16.0f,(f/16)/16.0f); } cool - would it be possible to use something like this to calculate rolling tyres? Link to comment
ulf.schroeter Posted January 10, 2012 Share Posted January 10, 2012 In principal for sure but for low rotation rates I would expect some visible jumps between different atlas tyre frames (if you want to simulate tyre rotation without rotation of tyre geometry). Nevertheless a combination of tyre geometry rotation and speed-dependent texture frame selection of pre-motion-blurred tyre texture (with maybe 3-5 discrete rotation speed variants) can be used to avoid unwanted stroboscope-effects at higher rotation rates. Link to comment
danni.coy Posted January 10, 2012 Share Posted January 10, 2012 what about a combination of atlasing and rotating the texture coordinates Link to comment
ulf.schroeter Posted January 10, 2012 Share Posted January 10, 2012 Also possible. Regardless of actual approach increase of draw call count / posibble decrease of performance should be kept in mind as each per-instance modification of material parameters (e.g. texture parameters) will cause creation of an inherited material instance breaking engine instancing possibilities. Link to comment
danni.coy Posted January 17, 2012 Share Posted January 17, 2012 as it turns out we tend to have a lot of vehicles travelling at the same speed and at a constant speed but I will have to figure out how to make that work using instances Link to comment
Recommended Posts