Jump to content

Mirror texture blur


lazarmitic
 Share

Recommended Posts

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 :D

Link to comment
Share on other sites

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.  :D

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.  :)

Link to comment
Share on other sites

:)  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.)

Link to comment
Share on other sites

@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? :D

 

 

 

Link to comment
Share on other sites

:)  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!

Link to comment
Share on other sites

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.  :D

That is a NICE texture on that box, too.  Sparkle!  Love it!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...