Tag Info

Hot answers tagged

6

I'll try to answer to the best of my knowledge, with little knowledge about the specific case of UE4, but rather on the general technique. Graph based materials are as much programming as writing the code yourself. It just doesn't feel like it for people with no background on code, making it seemingly easier. So, when a designer links a "Add" node, he is ...


1

When you really want to get good performance, implement it in hardware using pixel shaders. The graphic cards GPU is optimized for performing the same operation on lots and lots of values in parallel, so it does so really quick. When you don't want to learn GPU programming, there are many libraries available which implement many common blend effects in ...


1

The problem was inside present parameters - i forgot to set backbuffer's width and height. dx_PresParams.Windowed = TRUE; dx_PresParams.SwapEffect = D3DSWAPEFFECT_DISCARD; dx_PresParams.BackBufferFormat = D3DFMT_UNKNOWN; dx_PresParams.BackBufferWidth = 1024;//Width dx_PresParams.BackBufferHeight = 1024;//Height dx_PresParams.EnableAutoDepthStencil = TRUE; ...


1

You want linear interpolation using the alpha channel of the incoming (source) pixel. This goes by different names in different APIs (mix (...) in OpenGL, lerp (...) in D3D). No matter what you call it, it boils down to the following: public static int alpha_blend(int c1, int c2) { int a1 = (c1 & 0xff000000) >>> 24; //int a2 = (c2 ...


1

To test culling, you probably want to render to another target without the culling to see if your culling strategy is working as intended. Second, rather than putting the visible objects into a collection, instead have a flag on each objects on whether or not they are visible. When drawing, skip objects with the flag set to false. Assuming your view ...


1

Because the plane in front is alpha-blended over the entire screen, after all the alpha leaves behind it have been drawn as objects they are depth-sorted by Unity to render properly with alpha-blending. In your test without the front plane the cost of blending is minimal as all of the leaves use the same shader and texture which are in the cache and only ...


1

"Which of these options is better from a practical point of view?" I'll interpret the word "practical" here to be distinct from "theoretically highest performance on a computer"... At two triangles per sprite, recomputing all the vertices on the host CPU will be not that expensive, & easy to think about. Or, since all the geometries are the same (two ...


1

You aren't limited to having only one MVP per VBO. So you would not in fact need to update the VBO every frame just because you stuff all of your sprites into a single VBO. What I do is store an instance ID with each vertex, which changes only on a per-model basis, and use those instance ID's to index into a uniform array of mat4's, one for each "instance."



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