DigiHz Data Posted August 7, 2016 Share Posted August 7, 2016 These properties are not documented as far as i know. Are uAng and vAng values in radians? (If not, then what?) uAng and vAng is for rotating the texture in a material, but to get the texture to rotate we must affect BOTH uAng and vAng? Can someone please try to explain what wrapU and wrapV really does? (And how to use it). I tested changing the wrapU and wrapV without any viewable change at http://materialeditor.raananweber.com/ Quote Link to comment Share on other sites More sharing options...
Wingnut Posted August 8, 2016 Share Posted August 8, 2016 Hi DD! Yep, we need a section added to our Advanced Texturing tutorial, which covers these things. You can also read about these properties on the web. Texture scale, angle, offset, and wrap... are the "big 4" properties of texture mapping. Search on the web, and do some playground experimenting, you'll master the big 4 texturing properties easily. As you likely know, uvw is the same as xyz... but for textures. (they simply needed 3 more alphabet letters, so someone chose the 3 letters BEFORE xyz.... in the alphabet sequence). u = xvalue, v = yvalue, w = zvalue. Yep, i think uAng and vAng is radians. http://playground.babylonjs.com/#1SXPJA (that is a little testing and playing playground) It is a modification of our materials playground demo. Sorry it took so long to get you an answer. Hopefully you find/found some information on the web. Or you can play for 15 minutes in that playground demo, and you'll be a pro. Try mapping textures onto different BJS Basic Elements... for fun and learning... too. Animate these various properties, just like I did, or use sine and cosine ping-pong/orbit formulas... from our lights demo. FUN! Hope this helps. Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted August 8, 2016 Author Share Posted August 8, 2016 (edited) Hi Wingnut. uAng, vAng and wAng IS in radians. (I confirmed it now). Playing with your playground however does not affect wrapU or wrapV. I still need an explanation about what wrapU and wrapV really does. Edit: you use floats in your playground for wrapU and wrapV....I thought that wrapU and wrapV where integers. Edited August 8, 2016 by DigiHz Data Quote Link to comment Share on other sites More sharing options...
Wingnut Posted August 8, 2016 Share Posted August 8, 2016 Hi DD! Yeah, I knew my un-thorough answer was going to come back and bite me in the butt. Sorry about that. I was in a hurry, and didn't give you a proper answer. Let's see if I can do better. I'm not an expert AT ALL, not even close... but I did a little study, and got a playground that shows some things. http://www.babylonjs-playground.com/#1CJRM2#6 It appears that there are three possible settings for wrapU and wrapV... and you'll see them in lines 17-23. I believe BABYLON.Texture.WRAP_ADDRESSMODE is the default for both wrapU and wrapV. Activating line 18 or line 22... changes nothing... so I'll assume that to be true. Experiment... by activating lines 17, 19, 21, 23... preferably one at a time, and hit RUN each time, and watch. You'll see the differences. Sorry about the limp answer, this time, and last comment. To be truthful, I'm not very good at textures, and I was scared of telling you something incorrect. I still am. Maybe some REAL expert will visit and tell us what they know about this subject. If we learn enough, we can write a section of documentation... or convince the expert to write it for us. Aside: That is a picture of Ted Nelson, last seen hanging-out at a University in Hawaii. It is rumored that his writings... inspired Tim Berners-Lee to create an early version of the "World Wide Web". Ted thinks Tim made some wrong moves, and, well, you can read all about it. Ted invented a term/idea called transclusion and the theory is only in partial use, so far. It is related to a "mashup", which is a webpage whose parts are gathered from multiple sources... very common. Exciting, huh? (yawn) (snore) jerome 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted August 8, 2016 Share Posted August 8, 2016 Maybe this can help to understand the texture wrapping : http://docs.worldviz.com/vizard/Texture_wrapping.htm jerome 1 Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted August 9, 2016 Author Share Posted August 9, 2016 (edited) Hi Wingnut, I think i get it now. Thanks alot. I updated the playground to http://www.babylonjs-playground.com/#1CJRM2#7 typo error in http://www.babylonjs-playground.com/#1CJRM2#7 I updated the playgrond to http://www.babylonjs-playground.com/#1CJRM2#8 In your version you give example for direct access to the texture. I added reference to the materials texture. And thanks Daddy for your link. Edited August 9, 2016 by DigiHz Data Wingnut 1 Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted August 9, 2016 Author Share Posted August 9, 2016 A little bit of info, so that we not confuse anyone else about our previous posts about wrapU and wrapV. There are 3 different modes in BJS according to the constants in BJS source. Texture.CLAMP_ADDRESSMODE = 0; Texture.WRAP_ADDRESSMODE = 1; (This is the default) Texture.MIRROR_ADDRESSMODE = 2; Examples:(Taking the var's from the above playgrounds) On texture directly: outputplaneTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;// This is best way to use it. outputplaneTexture.wrapU = 0;// This is not so very good to use. (Maybee the constant changes in the future release of BJS) On materials texture channel: ground.material.diffuseTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;// This is best way to use it. ground.material.diffuseTexture.wrapU = 0;// This is not so very good to use. (Maybee the constant changes in the future release of BJS) Same for the 2 other modes. Wingnut, jerome, GameMonetize and 1 other 4 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted August 9, 2016 Share Posted August 9, 2016 Well said, well thunk, well tested, well done. AND... you just wrote a post that will serve as docs... when folks search the forum for answers... in the future. FYI: You can edit a URL in a forum post... by choosing edit (the message), then double-click on the URL, and a URL editing panel should pop-open. I have been known to change a URL to a playground demo... 5 times... AFTER the initial post was made. (when I open my mouth before I've completed my work). Thanks for the info, DD! Are you going to tackle/learn the 3 samplingMode and 9 coordinatesMode constants, next? We could have a BIG tutorial section... being created here. YAY! Materials is a big subject... lots to "doc" about. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 9, 2016 Share Posted August 9, 2016 Excellent thread. Love to read more of this Wingnut 1 Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted August 9, 2016 Author Share Posted August 9, 2016 I spent a few hours tonight getting it all right. Here is a great playground for you all to play around with that i made for FREE uOffset, vOffset, uScale, vScale, uAng, vAng, wAng,wrapU,and wrapV http://babylonjs-playground.com/#1HGNPS#0 jerome, Dad72, Wingnut and 1 other 4 Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted August 9, 2016 Author Share Posted August 9, 2016 Wingnut. Thx for that info about changing url. I not sure what to do next.To busy trying to make my editor stable enought so i can release a new version soon. Anyway, i do what i can for the forum and BJS (when i have the time). How do i add that link to people here (the blue background with users name) eg: @Wingnut Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted August 10, 2016 Share Posted August 10, 2016 Hi DD. Um, that "ping" tag is done while typing... start with typing the @ symbol... followed by one character, and then a drop-down panel opens with lots of usernames on it. For example, for me, type @ and then w... wait a moment... maybe type i... then type n. The list of names will get smaller and smaller as you type more letters after the @ symbol. So... type @wing, and then select my name from the list of names. Hard to describe. And, sometimes the system doesn't work. Generally speaking, type the word @wing and you should see a list... with my name in it. Just click or choose my name, and it puts that blue tag into your post. Practice a bit, and avoid hitting the escape button.... which seems to make it stop working. Other times, when I can't get the @ selector box to open... I have to save the message, then choose edit again, and then sometimes it works again. Also, the selector panel is white backdrop, so sometimes you don't notice it has opened and is offering you names to choose-from. The @ symbol is the key. Fantastic playground, by the way. Ya got some datGUI happening there... well done! Great learning tool!!! Excellent! Quote Link to comment Share on other sites More sharing options...
jerome Posted August 10, 2016 Share Posted August 10, 2016 really great demo Quote Link to comment Share on other sites More sharing options...
Dad72 Posted August 10, 2016 Share Posted August 10, 2016 Indeed, great demo. Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted August 10, 2016 Author Share Posted August 10, 2016 Thank you all. When we do make playgrounds, we should try to make them not only working, but understandable to. FYI: That demo run at 35 fps on my smartphone "Samsung Galaxy S5" jerome and Wingnut 2 Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted August 10, 2016 Author Share Posted August 10, 2016 Additional info again The playground i made before will only work 100% in BJS v2.5. I was using BJS v2.4 in my project, and i had problem with the wrapping modes (if i had more than 1 texture channel in a material). I downloaded the BJS v2.5 preview, and now it works in my project. This issue seams to have been fixed in BJS v2.5. Calling @Deltakosh . Can you explain what has changed about that? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 11, 2016 Share Posted August 11, 2016 My memory is failing But here is the what's new: https://github.com/BabylonJS/Babylon.js/blob/master/dist/preview release/what's new.md I do not think about something regarding texture wrapping Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted August 15, 2016 Author Share Posted August 15, 2016 @Wingnut I am not tackeling those things you mentioned yet. But i am tackling things about videoTexture, And there seam to be need for tutorials and more info about this. Many people (me included) have problems with videoTexture. So....I will open a new thread later named "videoTextures explained". and give some more in depth info about it. But...since i am going to see my wife and family FAR away, i do not know WHEN i have the time to do it. (Only Buddha knows ) 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.