Tag Info

New answers tagged

2

Your input layout defines POSITION as R32G32B32_FLOAT but Vertex's first member is an XMFloat4. This results in garbage in the TEX input. To fix the problem, switch to a XMFloat3 for the Vertex position member. Also, the offset for your NORMAL is set to zero - this should be D3D11_APPEND_ALIGNED_ELEMENT as well.


0

There are a few values that are crucial to multi-camera rendering in Unity: the culling mask, the clear flags, and the depth value. All three are mentioned in the camera component manual. mainCamera depth is -1, and NGUI Camera depth is 1. Unity draws cameras in ascending order. If you want the NGUI background behind the scene, you should flip those ...


1

I'm a newb to DirectX myself, but from what I've read, in HLSL, this: Texture textures[3]; Will actually be compiled like this: Texture textures0; Texture textures1; Texture textures2; So indexing into the array won't work.


0

If they get blurred be aware to import them in "Advanced" mode and disable "Mip Mapping" generation. Next check if any level of compression or filter is applied. Sometimes the filter tend to eat details of your image (try Point Filter or Bilinear Filter with small Anisotropic Level) Also the best result is obtained when your textures are painted "pixel ...


1

Basically you have to balance - reduced number of draw calls - small memory footprint at runtime - small application package size (as already said) I suggest to organize textures/sprites that are printed in the same scene in "Sprites Atlases" and keep the max resolution of atlases around 1024x1024 or 2048x2048. This, combined with some good scripting as ...


1

There are essentially two things to consider when thinking about the drawback of a larger texture size; performance and build size. Large textures are more complex to render so have higher requirements of the hardware. Large textures also make the build size much larger which may be an issue when considering the mobile market - mobile devices have less ...


0

texelFetch is used for lockups without performing mip-mappnig, filtering..etc. and even with this you still need to pass a sampler. Otherwise your out of luck, as far as I am aware, making such operation available restricts driver writers from doing certain optimization, for instance they need to keep textures in a certain layout in memory.


10

The PNG files are small because they are compressed. When the images are loaded into memory they are uncompressed and therefore take up more space.


0

It is very likely that your bmp loader does not load the alpha channel and fills it with a default value, as BMP with alpha channel is non-standard. Try using a .png file instead. From wikipedia: "An integrated alpha channel has been introduced with the undocumented BITMAPV3INFOHEADER and with the documented BITMAPV4HEADER (since Windows 95) and is used ...


0

Conservative rasterization is a fix for this problem. Thanks to Nathan Reed's comments, in preparation for the generation of a lightmap, I dilate the uv coordinates and recalculate they're associated positions based on the dilation. For each triangle: Compose an array of edges in uv space. For each edge: a. Compute the cross product using the edge ...


1

It's a simple interpolation. Let's assume that your heights span -1 to 1, 0 is water surface and you have 3 colours: dark green, light green and white. A way to do what you want is to have the following color_from_height function in the pixel or fragment shader (depending on how efficient you want to be). In my shader below I visualize the gradient, but the ...


0

3000x3000 is 9,000,000 pixels. 300x300 is 90,000 pixels. 30x30 is 900 pixels. It all comes down to how much 'art' you want on the texture. I would use the smallest resolution needed to get your art to look correct at its optimal viewing distance from the game camera. You also want to think about memory considerations. A 30x30 texture takes up less space ...


1

Yes, there are many. Game design is just like any art form, and minimalism can be done extremely well. Here's one example that comes to mind: http://superhotgame.com/ They make use of contrast (red vs. white) and slow motion (glass/people shattering) to get their cool factor.


0

You could look at projecting your texture (decal) onto a surface. Wolfire have a good blog post to get started on decal projection here.


0

As Namek says, one way is to bind the overlay texture and do the adding yourself in the pixel shader. Alternatively, re-render the geometry that contains the glyphs using additive blending and bind the overlay textures instead of the regular ones. Depth test should be enabled, depth writes should be off, and you would need to add a small depth bias to ...


2

Yes. There an article about this by Chris­t­ian Schüler: http://www.thetenthplanet.de/archives/1180 It's a followup to a book article (ShaderX 5) which did exactly what you need. I've used it myself. Here is the part that you need: (p : world-space position, N : world-space normal) mat3 cotangent_frame( vec3 N, vec3 p, vec2 uv ) { // get edge vectors ...



Top 50 recent answers are included