材料は
・全周囲の画像
制作ツールは
・Softimage
・AMD CubeMapGen
デス
全周囲画像
全周囲の画像は撮りためてたHDRマップを使います。
ちなみにいままで仕事で一度も使えてません orz
仕様は 8BitRGB なので
Photoshopでトーンを調整しつつ
32bit > 8bitに落とし、
余分なものを削除します。
地面はSIで製作しますので、鏡面にし、リタッチしました。

おおう、我ながらすばらしい。
SoftimageでCubeMap用の背景の作成

キューブマップ用にモデリングします
とはいっても、地面と、天球です。
ちょいちょいと。
天球と地面の接触部、地平線をなじませるため透明度など入れてます
フェイクフェイク。
で、CubeMap用のカメラをスクリプトで作成します。
CubeMapMaker
#Python
#CubeMapMaker
#CubeMapのためのカメラ、Passを製作します
#
#10 16 2012
#
app = Application; log = app.LogMessage
Cameras = ["x","xi","z","zi","y","yi"]
D3D = True
CameraInterPos_D3D = [[1,0,0],[-1,0,0],[0,0,1],[0,0,-1],[0,1,0],[0,-1,0]]
CameraInterPos_OGL = [[1,0,0],[-1,0,0],[0,0,1],[0,0,-1],[0,-1,0],[0,1,0]]
ImageSize = 1024
def createPass(in_Cam):
oCam = in_Cam
oCurrentPass = app.ActiveProject.ActiveScene.ActivePass
oPass = app.CreatePass("pass",oCam.Name + "_Pass")(0)
app.SetValue(str(oPass) + ".Main.Format", "tga", "")
oPass.Camera = oCam
oPass.ImageFormatOverride = True
oPass.ImageFormatPreset = 0
oPass.ImageLockAspectRatio = False
oPass.ImagePixelRatio = 1
oPass.ImageAspectRatio = 1
oPass.ImageWidth = ImageSize
oPass.ImageHeight = ImageSize
return oPass
def setCamParam(in_Cam):
oCam = in_Cam
oCam.std = 0
oCam.aspect = 1
oCam.pixelratio = 1
oCam.fov = 90
def createCubeMapCamera():
oRoot = app.ActiveSceneRoot
oModel = oRoot.AddModel("","CubeCameras")
oPos = XSIMath.CreateVector3()
oCamColl = XSIFactory.CreateObject("XSI.Collection")
for i,oCamName in enumerate(Cameras):
oCam = oModel.AddCamera("Camera",oCamName)
oInter = oCam.Interest
oInter.Name = oCamName + "_Interest"
if D3D == True:
oPos.Set(
CameraInterPos_D3D[i][0],
CameraInterPos_D3D[i][1],
CameraInterPos_D3D[i][2])
else:
oPos.Set(
CameraInterPos_OGL[i][0],
CameraInterPos_OGL[i][1],
CameraInterPos_OGL[i][2])
oTrans = oInter.Kinematics.Global.Transform
oTrans.SetTranslation(oPos)
oInter.Kinematics.Global.Transform = oTrans
#yAxiz upVect
if i == 4:
oCam.Kinematics.Global.rotY = 0
if i == 5:
oCam.Kinematics.Global.rotY = 0
setCamParam(oCam)
oCamColl.Add(oCam)
return oCamColl
#PPG現在は作成していない
def addCustomProp():
oRoot = app.ActiveSceneRoot
for oProp in oRoot.Properties:
if oProp.Name == "CubeMapPPG":
return oProp
oProp = oRoot.AddCustomProperty("CubeMapPPG")
ol = oProp.PPGLayout
oItem = ol.AddButton("CreateCubeMapCameras")
oItem = ol.AddButton("RenderCubeMap")
return oProp
def main():
oCams = createCubeMapCamera()
aPassColl = XSIFactory.CreateObject("XSI.Collection")
for oCam in oCams:
setCamParam(oCam)
for oCam in oCams:
oPass = createPass(oCam)
aPassColl.Add(oPass)
# CFrame = app.GetValue("PlayControl.Current")
# for oPass in aPassColl:
# app.RenderPasses(oPass, CFrame, CFrame, 1, "siRenderVerbosityDefault")
#
#app.DeleteObj(aPassColl)
#oProp = addCustomProp()
#app.InspectObj(oProp)
main()
PPGを作るつもりで、途中で投げてますね
まあ、必要十分ということでさらしておきます :p
6方向それぞれののパスが出来ますので
カレントフレームをAll Passで
レンダリングしていただければOKです
CubeMapGen

ATIのCubeMapGenでレンダリングした画像を読み込み、
dds形式で保存します
おおう、z ,ziが逆ですた :p
CubeMapGenは確認しながら設定できるので楽ですね(ごまかした
というわけで書き出したddsがこちらになります

EF-12に組み込む
ddsの名前をSkyFine.ddsにしたならば、上書きでOKですstg\userstage\sky\SkyFine
こちらのフォルダのファイルに上書きしちゃいましょう

というわけでCubeMapの検証が取れました :p
おつかれさまでした :p
実は全周囲画像を用意するというのが、一番ハードルが高かったりします orz
0 件のコメント:
コメントを投稿