#author("2023-12-29T13:11:47+00:00","default:iseki","iseki")
** OpenSim ジオラマ 開発用 [#w8cfb9a8]
 AddDynamicTextureURL()
 RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams);
    contentType を持つモジュールの AsyncConvertUrl() を呼び出す.


*** RenderTerrainScale [#o1907c41]
- void LLDrawPoolTerrain::renderFullShader() の sDetailScale
- デフォルトは 7, テクスチャは (リージョンサイズ/7) 個繰り返し表示される.1/7 = 0.14285714
- UVMap は (リージョンサイズ/7) 倍される.
- 256にすれば,1枚の画像.


*** Terrain Texture [#ta44cfc7]
- llviewerregion.cpp
-- void LLViewerRegion::unpackRegionHandshake()
--- Texture のUUID をセット 

- Render
-- pipeline.cpp  LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
--- p->reander(i)
---- lldrawpoolterrain.cpp   LLDrawPoolTerrain::render(S32 pass)


                                                 llviewerlayer.cpp
                                                        ↓
 llseurfacepatch.cpp → llvicomposition.cpp  →  llvierwerrecion.cpp
                                     ↓                 ↓
                                     →          lldrawpoolterrain.cpp
 



*** Tecture Functions [#zd2d2e9c]
- lldrawpoolterrain.cpp
 void LLDrawPoolTerrain::renderFullShaderX()
 {
	// Hack! Get the region that this draw pool is rendering from!
	LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
	LLVLComposition *compp = regionp->getComposition();
	//
	LLViewerTexture *detail_texture0p = compp->mDetailTextures[4];
 
	//
	sDetailScale = 0.142857/36.;
 
	LLVector4 tp0, tp1;
	
	tp0.setVec(sDetailScale, 0.0f, 0.0f, 0.0);
	tp1.setVec(0.0f, sDetailScale, 0.0f, 0.0);
 
	//
	// detail texture 0
	//
	S32 detail0 = sShader->enableTexture(LLViewerShaderMgr::TERRAIN_DETAIL0);
	gGL.getTexUnit(detail0)->bind(detail_texture0p);
	gGL.getTexUnit(0)->activate();
 
	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
	llassert(shader);
		
	shader->uniform4fv(LLShaderMgr::OBJECT_PLANE_S, 1, tp0.mV);
	shader->uniform4fv(LLShaderMgr::OBJECT_PLANE_T, 1, tp1.mV);
 
	gGL.matrixMode(LLRender::MM_TEXTURE);
	gGL.loadIdentity();
	gGL.matrixMode(LLRender::MM_MODELVIEW);
 
	// GL_BLEND disabled by default
	drawLoop();
 
	// Disable multitexture
	sShader->disableTexture(LLViewerShaderMgr::TERRAIN_DETAIL0);
 
	//----------------------------------------------------------------------------
	// Restore Texture Unit 0 defaults
	
	gGL.getTexUnit(detail0)->unbind(LLTexUnit::TT_TEXTURE);
	gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
	gGL.getTexUnit(0)->activate();
	gGL.matrixMode(LLRender::MM_TEXTURE);
	gGL.loadIdentity();
	gGL.matrixMode(LLRender::MM_MODELVIEW);
 }

- llviewerregion.cpp
-- void LLViewerRegion::unpackRegionHandshake()
	mCentralBakeVersion = region_protocols & 1; // was (S32)gSavedSettings.getBOOL("UseServerTextureBaking");
	LLVLComposition *compp = getComposition();
	if (compp)
	{
		LLUUID tmp_id;
 
		msg->getUUID("RegionInfo", "TerrainDetail0", tmp_id);
		compp->setDetailTextureID(0, tmp_id);
		msg->getUUID("RegionInfo", "TerrainDetail1", tmp_id);
		compp->setDetailTextureID(1, tmp_id);
		msg->getUUID("RegionInfo", "TerrainDetail2", tmp_id);
		compp->setDetailTextureID(2, tmp_id);
		msg->getUUID("RegionInfo", "TerrainDetail3", tmp_id);
		compp->setDetailTextureID(3, tmp_id);
 
		// Iseki
		tmp_id.set("1c5e544e-9198-4681-b87e-9868ae61e461"); 
		compp->setDetailTextureID(4, tmp_id);


- llvlcomposition.h
	enum ECorner
	{
		SOUTHWEST = 0,
		SOUTHEAST = 1,
		NORTHWEST = 2,
		NORTHEAST = 3,
		// Iseki
		//CORNER_COUNT = 4
		CORNER_COUNT = 5
	};


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 ページ一覧 検索 最終更新   ヘルプ   最終更新のRSS