当前位置: 首页>>代码示例>>C#>>正文


C# GraphicFactory.MipMapTexture方法代码示例

本文整理汇总了C#中GraphicFactory.MipMapTexture方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicFactory.MipMapTexture方法的具体用法?C# GraphicFactory.MipMapTexture怎么用?C# GraphicFactory.MipMapTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GraphicFactory的用法示例。


在下文中一共展示了GraphicFactory.MipMapTexture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: QuadTerrain


//.........这里部分代码省略.........
                                }
                                //Corner Bottom
                                if (PlusXVBIndex == i)
                                {
                                    if (x < terrainHeight - 1)
                                    {
                                        //MessageBox.Show(x + "Bot " + y + " " + x % (VBsize - 1) + " " + (y % (VBsize - 1) + (VBsize - 1)) + " " + i);
                                        allVertices[i + 1][(x % (VBsize - 1)) + ((y % (VBsize - 1) + (VBsize - 1)) * VBsize)].Position = new Vector3(x * scale, heightStore[x, y] * height, y * scale);
                                        //allVertices[i + 1][(x % (VBsize - 1)) + ((y % (VBsize - 1) + (VBsize - 1)) * VBsize)].Normal = normalVector;
                                        //Add this vertex to VB i+1, at location ((x % (VBsize - 1)) + ((y % (VBsize - 1) + (VBsize - 1)) * VBsize)
                                    }
                                }
                            }
                        }


                        if (i == 0)
                        {
                            int stepSize = (terrainWidth - 1) / (vertexBufferSize - 1);
                            int numberOfSteps = (terrainWidth - 1) / stepSize;
                            if (x % stepSize == 0 && y % stepSize == 0)
                            {
                                allVertices[0][(x / stepSize) + (y / stepSize) * VBsize].Position = new Vector3(x * scale, heightStore[x, y] * height, y * scale);
                                //allVertices[0][(x / stepSize) + (y / stepSize) * VBsize].Normal = normalVector;
                                //Add this vertex to VB 0, at location ((x/stepSize) + (y/stepSize) * VBsize)
                            }
                        }
                    }
                }
            }
            //Generate the normal texture from the normal data generated a second ago.
            normalTexture.SetData<Color>(normalData);

            factory.MipMapTexture(ref normalTexture);            
                       

            ////////////////////////////////////////////////////////////
            //Add to vertex buffer
            for (int j = 0; j < numberOfVBs + 1; j++)
            {
                allVBs[j].SetData<VertexPosition>(allVertices[j]);
            }
            ////////////////////////////////////////////////////////////


            #region depricated
            // int[] nodeStatsArray = new int[6,6];
            //for (i=HeightMap.Height-1;i>

            //   rootNode = new QuadNode(HeightMap, SquareSize, 4, 0, 0);


            //NodeDepth     Nodes   Total Nodes
            //0             1       1
            //1             4       5
            //2             16      21
            //3             64      85
            //4             256     341
            //5             1024    1365

            //allQuadNodes = new List<QuadNode>();


            //int NodeDepth = 0;
            //NodeLevel = (int)Math.Pow(2, (NodeDepth));
            //NodeScale = ((heightMap.Height - 1) / NodeLevel) + 1;
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:67,代码来源:QuadTerrain.cs


注:本文中的GraphicFactory.MipMapTexture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。