phil1234 Posted October 7, 2015 Share Posted October 7, 2015 hello everyone I found a tutorial that show how to do env mapping but it uses 6 separated imagesmost env map (inc blender generated and the one given in the tutorials as extra images) are one image combined is there a way to use such all-in-one image ? regards Quote Link to comment Share on other sites More sharing options...
RaananW Posted October 7, 2015 Share Posted October 7, 2015 The one single image mode is using a sphere instead of a cube, you can use the spherical projection instead of a cube texture. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 7, 2015 Share Posted October 7, 2015 To use spherical projection: material.reflectionTexture.coordinatesMode = BABYLON.Texture.SPHERICAL_MODE Quote Link to comment Share on other sites More sharing options...
dbawel Posted October 7, 2015 Share Posted October 7, 2015 If you unwrap UVs in a program such as Blender, and build a texture from your six images after unwrapping specifically to apply to your cube in a program such as Photoshop, then you will be able to apply your single texture to a cube uniquely covering all sides in BJS. However, as the resolution of this single texture will be much larger than the six individual images - and there will be areas of the single combined image (texture) which will be unused, I believe it is much more efficient to use the 6 images as textures for your cube - as opposed to a single combined image for your texture; since your overhead ( in image resolution) will be far less than the 6 individual images themselves For what reason would you want to combine all 6 images into a single image texture? DB Quote Link to comment Share on other sites More sharing options...
phil1234 Posted October 8, 2015 Author Share Posted October 8, 2015 tried Blender EnvMapping texture type ... just crap, then I just created a simple setup, with a camera at center, and 6 frames of animations,here is the scripts that does the render with the right texture names if anyone wants to do the same import bpyimport ospath=bpy.path.abspath("//");def RenameFile(i,fileName): scene=bpy.data.scenes['Scene'] scene.frame_set(i) scene.render.filepath = os.path.join(path,fileName); bpy.ops.render.render(write_still=True) # render still RenameFile(1,"skybox_ny.png");RenameFile(2,"skybox_pz.png");RenameFile(3,"skybox_py.png");RenameFile(4,"skybox_nz.png");RenameFile(5,"skybox_px.png");RenameFile(6,"skybox_nx.png"); but I got another issue: the tutorial (https://github.com/BabylonJS/Babylon.js/wiki/13-Environment) says all textures should be PNG files but the engine complains cos it's looking for JPG files is there an option for the CubeTexture to set it to PNG,DDS... ??? thanks Quote Link to comment Share on other sites More sharing options...
dbawel Posted October 8, 2015 Share Posted October 8, 2015 Edited out as my response applies to a seperate post. Quote Link to comment Share on other sites More sharing options...
jerome Posted October 8, 2015 Share Posted October 8, 2015 Depending on how is your single texture file, you've got this way too : http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors Quote Link to comment Share on other sites More sharing options...
phil1234 Posted October 8, 2015 Author Share Posted October 8, 2015 Depending on how is your single texture file, you've got this way too : http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors nice Quote Link to comment Share on other sites More sharing options...
phil1234 Posted October 8, 2015 Author Share Posted October 8, 2015 To use spherical projection: material.reflectionTexture.coordinatesMode = BABYLON.Texture.SPHERICAL_MODE then the question would be how you generate a spherical progection texture 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.