Hot answers tagged

19

Under D3D9 with XPDM you almost certainly want to instance wherever possible. Draw call overhead is just so high that it makes sense. In that scenario the crossover-point can be as low as 2 or 3 instances. If you've only got one instance of a given mesh, it may on the surface seem tempting to draw it non-instanced. However, look at what's involved: You ...


13

Typical UV mapping is what's called an affine transformation. That means the mapping of each triangle between 3D space and texture space can include rotation, translation, scaling/squash, and skew (ie. anything we can do with a homogeneous matrix multiplication) The thing about affine transformations is that they're uniform across their whole domain - the ...


12

I've done a fair bit of work in this area, although most of my demos are older: (flash 2010) http://genesisbbs.com/appstem.html (click and drag mouse) http://genesisbbs.com/appstem2.html (directX 2006) http://vimeo.com/5206795 I highly encourage you to roll your own, if you are doing this for fun. You will almost certainly need to work with ...


12

(On my system, didn't test it anywhere else) In GL, instancing a single mesh (drawing with count = 1) has some nasty overhead, but I don't know where it comes from. I strongly suggest not doing it. I tested this in a practical application a couple of months ago. I coded some global illumination algorithms in the Crytek Sponza scene, which consists of ...


12

Definitions: Progressive meshes: This method involves the saving of mesh as a collective structure which contains several copies of the same mesh in different LOD. In this technique, the whole of the mesh is made into one with lower resolution. Adaptive meshes: Rather than enumerate the huge number of polygons that would be required to get an accurate ...


11

Modern graphics APIs are very careful about specifying how rasterization of triangles that share edges will be done in order to avoid overlapping fragments and missing fragments. Fabien Giesen mentions one of these rules in his article series on the graphics pipeline, cited here: you need to have tie-breaking rules to ensure that for any pair of ...


7

Create an octree and in each leaf cells put the list of all triangles from B that intersect the cell, mark at each levels whether or not the cell is empty. If one cell at any level has only 1 poly note the poly so you can stop the search early (large floor/wall triangles). You can keep sub-dividing cells until you have a reasonable number of triangles in ...


6

This distortion pattern is an aliasing artifact caused by point sampling the wrong mip level of a texture. Change the "Filter Mode" from "Point" to bilinear, and make sure to check "Generate Mip Maps". (There is rarely a good reason to disable mip-map generation.) As some have suggested in the comments, anisotropic filtering will work even better to ...


6

Solving the bounding sphere problem Computing the bounding sphere for a set of given vertices means solving the minimum covering circle problem in three dimensions. There're many algorithms out there to find such a bounding sphere, like Welzl's algorithm (at this page you can find an implementation in Java), and many others. You can also check out Fischer's ...


6

Remember, the whole point of using a chunk mesh is to try to render just the outside skin, and hide all the internal detail inside the chunk where we can't see it. If we generate a whole cube (all 12 triangles) at every occupied position, then we might as well spawn it as a separate mesh and at least hope GPU instancing saves us some work - otherwise we're ...


5

I think the obj file format is what you need. OBJ is pretty commonly used in 3D graphics, and it's a text file. You will need to walk through your mesh properties and write your own file. Then you'll be able to load and display it.


5

Ok. I did it. I'll give a brief description- if someone in the future needs more details feel free to request source. Because it's tiled, my "non-tiled" solution for generating a delaunay mesh doesn't work. It starts by creating a 4 bounding corner points, dividing them into 2 triangles, and then adding one point at a time (each added point subdividing the ...


4

Unfortunately there is no way to do this. What you'll need to do is duplicate the data in places: TexCoords: 1: 0.67, 0.54 Vertices: 1: 14.65, 24.09, 87.65 2: 54.76, 34.78, 17.52 Where both these use texture coordinate 1, we need to copy texture coordinate 1 so there are two instances to it. We'll end up with: Final Vertex Data: 1: V 14....


4

You're looking at points on a continuum as if they're alternatives - Consider resolving a NURB to screen resolution, i.e. each pixel ties to an evaluation of the NURB for that point - the end result is that you're moving from a set of continuous functions to a discrete representation produced by evaluating those functions at specific points. In the most ...


4

Terrain mesh generation is a general term for the process of... generating a mesh for the terrain. Ok, let me elaborate. A mesh is a generic term for a 3D model. It usually consists of vertex positions (set up as triangles), normals, texture coordinates and other information required to render the model properly. If you don't know how meshes work, you need ...


4

Essentially, the normal of the vertex would be the average of the adjacent faces' (triangles) normals. In pseudocode: for each face adjacent to vertex[n] sum = sum + face.normal normal[n] = NORMALIZE(sum / COUNT(adjacent faces)) Repeat for each vertex.


4

Try this: Generate random points Compute delaunay triangulation of those points Use those delaunay triangles as your mesh By restricting the domain and distribution of the random points, you can control the height of your terrain more carefully. If you want to go beyond this and generate consistent terrain, or geometries that aren't just random mess, you ...


4

First of all if you are interested in generating meshes I recommend to you this series of articles in gamasutra about procedural meshes Modelling by numbers So returning to the main question, generate planes procedurally allows you to define the distribution of the vertex, for example I use this kind of methods to generate low poly terrains So if you want ...


4

I believe that might be related to "shadow acne." Try lowering the bias of your directional lights. http://answers.unity3d.com/questions/925812/unity-5-real-time-lights-cast-shadows-with-gaps-li.html


4

Well that collider might not even belong to the game object you are currently selecting, try to go through each game object that is a child object and you'd probably find it. And when you do you can remove it by right clicking the component and clicking "Remove Component". If it still doesn't work send me the project file cuz I can't make out what is what ...


4

Typically, your list of indices looks like this: [ 1st vertex index of triangle 0, 2nd vertex index of triangle 0, 3rd vertex index of triangle 0, 1st vertex index of triangle 1, 2nd vertex index of triangle 1, 3rd vertex index of triangle 1, 1st vertex index of triangle 2, ...etc ] So the three vertices of triangle i are: vertices[indices[...


4

First, create a simple mesh (such as a quad or a cube). Place it over top the actual game area, and stretch it so that it covers the entire camera view. Next, create a new shader named "ObscurityShader", and paste in the following shader code: Shader "Custom/ObscurityShader" { SubShader { Tags{"Queue" = "Transparent+1" "RenderType" = "...


3

The reason for this is that there's no difference in general. A most basic model or mesh consists of vertices only. Vertices by itself can use different formats and as such may contain different data, for example they could optionally include color data, texture coordinates, and normal vectors. They might as well include data for animations, e.g. weights ...


3

Unity's Mesh class has an Optimize method which should give you what you want. From the wiki page: You should use it if you generate a mesh from scratch procedurally and you want to trade better runtime performance against higher load time.


3

The main problem with procedural trees is not generating them, but rendering them all every frame at runtime. This is the reason you will see many identical trees in AAA games, it's not that they couldn't implement or write tech that created unique trees, it's that it would mean you'd have to cut out a load of other features for the game to run. If you have ...


3

Personally I would probably start with pre-generated trees and only once I'd have a kick-ass forest rendering engine - complete with bushes, grass, mushrooms and stuff - would I start looking if I need more variable tree meshes. That being said, you could take a look at ngPlant. It includes a GPL procedural tree modeler app, but the libraries that do all ...


3

You might consider something like Wang Tiles. The idea is that you have a predetermined set of edges for your tiles. You can randomly generate tiles, still, so long as the edges match. For example, you might have 4 possible sides: A: Low terrain B: Mid terrain C: High terrain D: Water You can generate the first tile by randomly choosing the 4 sides. The ...


3

This can be done in general using a shape where you can get the normals at any point. It's particularly easy if the shape is a circle or an ellipse, because we can just use the parametric equation for the ellipse to give the position and normal. One of the problems now is that to cut up the curve into segments, you should know the arc-length of each segment....


Only top voted, non community-wiki answers of a minimum length are eligible