Jump to content

cubemap with one image


phil1234
 Share

Recommended Posts

hello everyone

 

I found a tutorial that show how to do env mapping

 

but it uses 6 separated images

most 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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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