Unity3D制作的室内效果(含有源文件)
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 68937 2009-10-19 02:24 exampleprojectAssetsLightmappingToolsconversor.mse
文件 13147 2009-11-07 15:11 exampleprojectAssetsLightmappingToolsEditorCalcArea.cs
文件 234 2009-09-09 00:48 exampleprojectAssetsLightmappingToolsEditorHelp.cs
文件 55533 2009-11-07 14:32 exampleprojectAssetsLightmappingToolsEditorLightmappingTool.cs
文件 2681 2009-10-19 01:24 exampleprojectAssetsLightmappingToolsEditorLookForLightmaps.cs
文件 6044 2009-10-19 01:24 exampleprojectAssetsLightmappingToolsEditorPrepareBatchscript.cs
文件 50386 2009-11-08 19:40 exampleprojectAssetsLightmappingToolsEditorSaveFBX.cs
文件 5902 2009-10-19 01:24 exampleprojectAssetsLightmappingToolsEditorStorePreferences.cs
文件 2642 2009-10-19 01:24 exampleprojectAssetsLightmappingToolsEditorSwitchWindows.cs
文件 514 2009-10-19 02:24 exampleprojectAssetsLightmappingToolsExternalLightmappingTool-BumpedDiffuse.shader
文件 723 2009-10-19 02:24 exampleprojectAssetsLightmappingToolsExternalLightmappingTool-BumpedSpecular.shader
文件 456 2009-10-19 02:24 exampleprojectAssetsLightmappingToolsExternalLightmappingTool-Diffuse.shader
文件 3488 2009-10-19 02:24 exampleprojectAssetsLightmappingToolsExternalLightmappingTool-VertexLit.shader
文件 9678 2009-10-19 02:24 exampleprojectAssetsLightmappingToolslogo.png
文件 9605 2009-10-19 02:24 exampleprojectAssetsLightmappingToolslogo2.png
文件 8737 2009-10-19 02:24 exampleprojectAssetsLightmappingToolsmaxscriptEngine.ms
文件 1077 2009-10-19 02:24 exampleprojectAssetsLightmappingToolsuvDebug.shader
文件 7214231 2009-09-11 18:35 exampleprojectAssetsLightmapsscenelightmap1.png
I.A.... 4016 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-corner_closet.mat
I.A.... 4003 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-dressoir.mat
I.A.... 3998 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-hat.mat
文件 3837 2009-09-11 15:18 exampleprojectAssetsMaterialsshop_scene-lamps.mat
I.A.... 4003 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-manequin.mat
I.A.... 3998 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-red.mat
I.A.... 4001 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-saddle.mat
I.A.... 4000 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-shelf.mat
I.A.... 4000 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-shoes.mat
I.A.... 3999 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-shop.mat
I.A.... 4015 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-shop_stand_1.mat
I.A.... 4015 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-shop_stand_2.mat
............此处省略288个文件信息
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
/*
Coded for Unity Summer of Code 2009 by Michal Mandrysz
Feel free to modify for your own needs
http://masteranza.wordpress.com/unity/lightmapping/
http://unity3d.com
*/
class CalcArea
{
static public int whichLightmap=1;
public static Rect[] CalculateArea(MeshFilter[] mf int resolution ArrayList transformedVerticles)
{
ArrayList surfaces = new ArrayList();
MeshFilter temp;
float totalArea = 0;
Vector3[] transVert;
for (int i = 0; i < mf.Length; i++)
{
transVert = (Vector3[]) transformedVerticles[i];
temp = (MeshFilter)mf[i];
float area = 0;
int count = temp.sharedMesh.triangles.Length / 3;
for (int j = 0; j < count; j++)
{
area += Math.Abs(Vector3.Cross(transVert[temp.sharedMesh.triangles[j * 3]] - transVert[temp.sharedMesh.triangles[j * 3 + 1]] transVert[temp.sharedMesh.triangles[j * 3]] - transVert[temp.sharedMesh.triangles[j * 3 + 2]]).magnitude);
}
surfaces.Add(area);
totalArea += Math.Abs(area);
}
return Packobjects(mf surfaces totalArea 1.00f resolution);
}
public static void CheckIfNormalized(MeshFilter temp)
{
//Path search
Transform current = temp.transform;
while (current.parent!=null)
{
current = current.parent;
}
UnityEngine.object prefabed = EditorUtility.GetPrefabParent(current);
string path = AssetDatabase.GetAssetPath(prefabed);
if (path.Length<1) path = “primitive.notAFile“;
if (temp.sharedMesh.uv2.Length == temp.sharedMesh.vertexCount)
{
Vector2[] uvs = temp.sharedMesh.uv2;
bool normalized = true;
for (int j = 0; j < uvs.Length && normalized; j++)
{
if (uvs[j].x > 1 || uvs[j].x < 0 || uvs[j].y < 0 || uvs[j].y > 1)
{
LightmappingTool.notNormalized2.Add(path);
LightmappingTool.notNormalized2.Add(temp.transform);
normalized = false;
}
}
//Overlapping test
if (SystemInfo.supportsRenderTextures)
{
Shader finded = Shader.Find(“ExternalLightmappingTool/uvDebug“);
if (finded == null)
{
Debug.LogError(“Cannot find uvDebug shader within LightmappingTools folder!“);
return;
}
int res = 128;
RenderTexture rt = RenderTexture.GetTemporary(res res 0);
RenderTexture.active = rt;
if (Camera.current == null)
{
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 68937 2009-10-19 02:24 exampleprojectAssetsLightmappingToolsconversor.mse
文件 13147 2009-11-07 15:11 exampleprojectAssetsLightmappingToolsEditorCalcArea.cs
文件 234 2009-09-09 00:48 exampleprojectAssetsLightmappingToolsEditorHelp.cs
文件 55533 2009-11-07 14:32 exampleprojectAssetsLightmappingToolsEditorLightmappingTool.cs
文件 2681 2009-10-19 01:24 exampleprojectAssetsLightmappingToolsEditorLookForLightmaps.cs
文件 6044 2009-10-19 01:24 exampleprojectAssetsLightmappingToolsEditorPrepareBatchsc
文件 50386 2009-11-08 19:40 exampleprojectAssetsLightmappingToolsEditorSaveFBX.cs
文件 5902 2009-10-19 01:24 exampleprojectAssetsLightmappingToolsEditorStorePreferences.cs
文件 2642 2009-10-19 01:24 exampleprojectAssetsLightmappingToolsEditorSwitchWindows.cs
文件 514 2009-10-19 02:24 exampleprojectAssetsLightmappingToolsExternalLightmappingTool-BumpedDiffuse.shader
文件 723 2009-10-19 02:24 exampleprojectAssetsLightmappingToolsExternalLightmappingTool-BumpedSpecular.shader
文件 456 2009-10-19 02:24 exampleprojectAssetsLightmappingToolsExternalLightmappingTool-Diffuse.shader
文件 3488 2009-10-19 02:24 exampleprojectAssetsLightmappingToolsExternalLightmappingTool-VertexLit.shader
文件 9678 2009-10-19 02:24 exampleprojectAssetsLightmappingToolslogo.png
文件 9605 2009-10-19 02:24 exampleprojectAssetsLightmappingToolslogo2.png
文件 8737 2009-10-19 02:24 exampleprojectAssetsLightmappingToolsmaxsc
文件 1077 2009-10-19 02:24 exampleprojectAssetsLightmappingToolsuvDebug.shader
文件 7214231 2009-09-11 18:35 exampleprojectAssetsLightmapsscenelightmap1.png
I.A.... 4016 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-corner_closet.mat
I.A.... 4003 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-dressoir.mat
I.A.... 3998 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-hat.mat
文件 3837 2009-09-11 15:18 exampleprojectAssetsMaterialsshop_scene-lamps.mat
I.A.... 4003 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-manequin.mat
I.A.... 3998 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-red.mat
I.A.... 4001 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-saddle.mat
I.A.... 4000 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-shelf.mat
I.A.... 4000 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-shoes.mat
I.A.... 3999 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-shop.mat
I.A.... 4015 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-shop_stand_1.mat
I.A.... 4015 2009-09-29 13:01 exampleprojectAssetsMaterialsshop_scene-shop_stand_2.mat
............此处省略288个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)