lazarmitic Posted February 10, 2016 Share Posted February 10, 2016 Hey peps, is there a way to blur mirror texture? I don't want it to look so sharp like real mirror but add some blur to it. I know I can use alpha from specular map to get some sort of filter so it does not look like perfect mirror, but that is not really a solution to my problem. Thanks for taking the time to read and maybe answer Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted February 10, 2016 Share Posted February 10, 2016 hi you can use rendertarget and postprocess to make this you can use to texture2D( renderTargetTexture , uv , 1 /* 1..5 is blur */); Quote Link to comment Share on other sites More sharing options...
lazarmitic Posted February 11, 2016 Author Share Posted February 11, 2016 Hey thanks for help. Does this method with render target affects whole mirror plane or just reflection texture ? Thanks again for help Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted February 12, 2016 Share Posted February 12, 2016 rendertarget can make your mirror texture and you can use that for reflect Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 12, 2016 Share Posted February 12, 2016 You're a wild man, Nasi! I had a retarded idea. I tried to violently jiggle the uOffset and vOffset of reflectionTextures used in the mirrors... via random numbers in the render loop animation. (lines 196-202) It failed to blur the reflections, but I had a good time trying it. http://playground.babylonjs.com/#QSFNK#4 You guys see the sparticles (sparkly particles) dancing on the surface of one side of the green box? It gave me an idea... SparticleMaterial. Somebody code that up while I play Space Engineers and SpinTires. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 12, 2016 Share Posted February 12, 2016 hehe..this is because reflectionTextures use generated texture coordinates (to project the texture) and thus do not use uOffset and vOffset Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 13, 2016 Share Posted February 13, 2016 Thanks DK! @NasimiAsl Ok... wow. Would you (or anyone) be willing to make us a playground for that? texture2d? That's a shader thing there, I suspect. I was looking at mirrorTexture source... moments ago. It's amazing. You 2D procedural texture guys... wow. At a glance, it looks like mirrorTexture creates a fake camera at the orientation of the reflection, and just gulps the view into a buffer, and then creates a dynamicTexture out of it... using various clampings and uv mappings. (I need to teach these things at the senior citizen's center later, so I keep the terminology simple/pseudo.) renderTargetTexture IS that 'view from the fake camera', correct? TEACH US STUFF, NASI! (if you please). Can this stuff be done in a playground? You post-process render pipeline workers... you're scary but cool. (yeah, I know, mirror blurring probably isn't "post" or "pipeline" at all.) Any chance this can go to the next level... mirror image distorting? Refraction index? (I just learned 'refraction index' from DK's new PBR demo... and it causes reflection distorting... so I thought it might be fun on mirrors.) Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted February 14, 2016 Share Posted February 14, 2016 @Wingnut Yes I think I can do This ( 80% - 100% in theory ) but i have full task for this week if it Possible i try this next week .just remember me please i think 3 part need to do this 1. create render target With other camera ( calculate Position of new camera With center position MirrorMesh and normal (average normal's) and current camera Position) * if we can change camera to new pos beforRenderTarget and back it afterRender we dont need create new camera ***** i dont now this is possible ( maybe need something overwrite ) * need Big View i think we can handle it with fov * if any possible we can make new Camera Type ( like Fisheyes Or .. ) we can have 1 texture from All Around (360.) so we cont need CubeTexture For Build Perfect Live That) 2. need Optimization Ram (GPU Ram For Live RenderTarget) because We need Bind Texture in every Frame * if Only Need Mirror We Can Handle That With PostProcess 3. Blur That * Use Blur texture2D parameters * Use Post Process Blur Like this Sample http://www.babylonjs-playground.com/#URP3W#12 and use like this http://www.babylonjs-playground.com/#1HECPU%234 @Wingnut just for fun you call me 'Wild' is that good? Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 14, 2016 Share Posted February 14, 2016 Yes, "wild" is good, in MY dictionary. heh. Thanks for the instructions/ideas, and playgrounds! Maybe I, lazarmitic, or others... will get this started and/or do some experiments. Maybe mirrorTexture blur is important enough to become a permanent feature of mirrorTextures. Maybe it will be too "heavy" for a permanent feature. *shrug* I invite all contributors/ideas, and likely lazarmitic does, too. Thanks! Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted February 14, 2016 Share Posted February 14, 2016 You make me Wild To Test That Now Wingnut 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted February 14, 2016 Share Posted February 14, 2016 http://www.babylonjs-playground.com/#1HECPU#32 without blur http://www.babylonjs-playground.com/#1HECPU#33 with blur in my planning something is wrong i apologize i make with postprocess for fake camera in this sample it is demo and need optimizing jerome, Temechon, Wingnut and 1 other 4 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 14, 2016 Share Posted February 14, 2016 Fantastic! No need to apologize at all. You have advanced this challenge by 100 miles! Well done! (and fast, too) I decided to "adjust" the blur demo... try to improve indenting, variable names, and fix some playground errors (green squares along editor right-side). When I saved, it was http://www.babylonjs-playground.com/#1HECPU#43 #43!!! It seems many people are having fun with this, and making more saves... right now! Hot playground! eash - Easy Shaders - by NasimiAsl. To be frank, I still don't see much that is easy... about shaders. That is a NICE texture on that box, too. Sparkle! Love it! Temechon 1 Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted February 14, 2016 Share Posted February 14, 2016 @NasimiAsl Oh man, you really really are a shader god. Glad we have you here! Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted February 14, 2016 Share Posted February 14, 2016 thanks all and i do nothing while i finish publish and uploading eash . i do it in this week you can visit that in Friday http://eash.space Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.