thrice Posted May 28, 2017 Share Posted May 28, 2017 I.E., playing card with 2 sides. Not sure how to apply a material to the backside of a plane? I would think there must be support for this though, because of the fact that there is DEFAULTSIDE, FRONTSIDE, BACKSIDE, options right? Otherwise what is the point of having frontside backside? Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 28, 2017 Share Posted May 28, 2017 this is a new way that look like standard material but called custom material http://www.babylonjs-playground.com/#YXCHH1 * notic that your normal most be reversed in back face http://www.babylonjs-playground.com/#YXCHH1#1 Spankied 1 Quote Link to comment Share on other sites More sharing options...
thrice Posted May 28, 2017 Author Share Posted May 28, 2017 1 hour ago, NasimiAsl said: this is a new way that look like standard material but called custom material http://www.babylonjs-playground.com/#YXCHH1 * notic that your normal most be reversed in back face http://www.babylonjs-playground.com/#YXCHH1#1 Sorry I should have been more specific. How do I apply a different texture to the back of the plane? I.E., a playing card, you have a front side with the numbers, back side does not have numbers. Quote Link to comment Share on other sites More sharing options...
JohnK Posted May 28, 2017 Share Posted May 28, 2017 Two planes same position one FRONTSIDE one BACKSIDE. If any image interference separate slightly along plane normals Quote Link to comment Share on other sites More sharing options...
thrice Posted May 31, 2017 Author Share Posted May 31, 2017 On 5/28/2017 at 4:59 PM, JohnK said: Two planes same position one FRONTSIDE one BACKSIDE. If any image interference separate slightly along plane normals ah ok, that was going to be the next thing I tried but seemed wonky and figured it was built in due to the FRONTSIDE BACKSIDE options. But thinking through it further maybe that makes the most sense anyways, since each side has different interactions. Also the bigger thing I was hung up on was duplicating logic between the two planes if I take two and mash together but I suppose the best way to model it is parent plane with 2 child planes, then always target the parent when moving Quote Link to comment Share on other sites More sharing options...
jerome Posted May 31, 2017 Share Posted May 31, 2017 This gives me an idea about a simple feature to set different parts of the same image front and back side. Stay tuned ;-) Quote Link to comment Share on other sites More sharing options...
jerome Posted May 31, 2017 Share Posted May 31, 2017 PR coming soon [EDIT] Submitted. Quote Link to comment Share on other sites More sharing options...
jerome Posted May 31, 2017 Share Posted May 31, 2017 Please wait until the Big Shot accepts to merge the feature : PG example coming then ... Quote Link to comment Share on other sites More sharing options...
Gijs Posted May 31, 2017 Share Posted May 31, 2017 @jerome @NasimiAsl Maybe a shader can be made that uses a pixel from either the front or back image depending on whether a vertex normal is facing the camera NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 31, 2017 Share Posted May 31, 2017 Merged and available in the pG jerome and NasimiAsl 2 Quote Link to comment Share on other sites More sharing options...
jerome Posted May 31, 2017 Share Posted May 31, 2017 PG examples coming tomorrow Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 31, 2017 Share Posted May 31, 2017 We can detect that without uv Changes just need change vNormalW in default shader and make new diffuseColor and samplerColor in this case if we don't change uv map we can use atlas Map too for that that can be support Extra Object too because we just change shader Not any Attribute of object thinking about that in my solution we change vNormalW in varying to a simple global variable and just need change it to -1.0 * VNormal if gl_FrontFlag is Off ( for back face ) and some diffuse texture changes i test it in shader Builder but for standardMaterial we need a few changes if you agree for this i can make sample jerome and adam 2 Quote Link to comment Share on other sites More sharing options...
jerome Posted June 1, 2017 Share Posted June 1, 2017 Here is the related new feature : Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 1, 2017 Share Posted June 1, 2017 https://www.babylonjs-playground.com/#F5IEQE#6 i think some option of standard material use vNormalW and some other use normalW normalW=gl_FrontFacing ? normalW : -normalW that used in default shader but light don't correct normal in back side view fun : https://www.babylonjs-playground.com/#F5IEQE#8 https://www.babylonjs-playground.com/#F5IEQE#9 jerome 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 11, 2017 Share Posted June 11, 2017 correct normal https://www.babylonjs-playground.com/#F5IEQE#10 https://www.babylonjs-playground.com/#F5IEQE#12 jerome and GameMonetize 2 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.