Tag Info

New answers tagged

0

I'm not using DDSTextureLoader() functions myself, but it seems that the function creates appropriate shader resource view for you to match the DDS format and the associated sRGB space, thus you get about the same linearized result in the shader regardless if you use sRGB format in your DDS file or not. You could create your own SRV instead with fixed sRGB ...


2

SharpDX is a DirectX wrapper, not an XNA one. XNA's GetData methods are higher-level abstractions on top of the underlying DirectX functionality. If you're using the D3D9 interface, you probably want a variant of LockRectangle. If you're using D3D11 you probably want some variant of MapSubresource (or the similar method for D3D10). Note that in D3D9 the ...


1

Yes, this is a fine approach - it will be orders of magnitude faster than creating a primitive per data point. Assuming single-channel data, you should use whatever DXGI_FORMAT (or equivalent in OGL) maps to your source data, and convert in the pixel shader. There are native types for 8, 16, and 32-bit integers, as well as 32-bit floats. You should also ...


0

I would recommend using Sprite Textures. You will need to do the following: Set your texture type to Sprite (2D and UI). Set Sprite mode to Multiple. Access the Sprite editor and use the Slice tool (sneakily hidden in the upper left corner) From here, slice up the single image and get multiple sprites to your heart's content. Then you can use these ...


2

If you modify a material, it affects the objects that are using it. You need to duplicate that material, modify its texture and reassign it to the target object.


3

The only apparent error in your code is that you seem to specifying 4 mip-levels, from level 0 to level 3, however, you set GL_TEXTURE_MAX_LEVEL to 4. The max level is the zero-based index of the last mip-level, so in this case, it should be 3: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 3);


0

Depends on what you do. For a 3D game you have to test it in practice - if it looks good when the camera is the closest - then the size is fine (you can even try to decrease the size of the texture to save memory/bandwidth). For a 2D game (orthographic camera) having textures in the same size (in pixels) as they appear on the screen might not be a bad idea ...


1

Use an opacity map! Simply trace the outline of the eye in Photoshop, and make the "visible" part of the texture white, and the part you want invisible black. Then inside 3DS Max, go to your texture's mapping channels and insert the black and white image into "Opacity Map"—and voila! No more silly whiteness. P.S. The reason the black space shows up as ...


0

I assume your noise is outputting height values for the terrain - the style shouldn't matter, as that's applied after the noise is done with. Add a lower octave of noise and add (or otherwise combine) them together. The lower the octave (larger amplitude and lower frequency) the larger/longer the features it creates, so to add hills you need to add that sort ...


3

I'm not finding any way to do this within the cocos2d framework, so if someone can do that it would probably be a better answer. However, cc.Texture2D does have a getHtmlElementObj() function. Now, this function can return either an image element or a canvas element. If it returns an image, you need to make a canvas from it as shown in this answer: var ...


1

Given the documentation, it would seem that is the expected output. BC1 represents the data before compression as 5 bits red, 6 bits green, 5 bits blue, and 0 or 1 bits alpha, for 16 or 17 bits per pixel. BC4 represents it as one 8-bit channel, for 8 bits per pixel. However, then it compresses it. I'm not sure how exactly the compression works, but if you ...


3

glRotatef(GLfloat angle, Glfloat x, GLfloat y, GLfloat z); The Above function is what you need for your purpose. It " multiplies the current matrix by a rotation matrix", as the OpenGL documentation says. Here's how you use it- angle is the angle you want to rotate. (Duh.) The next three parameters define the axis around which you would like to rotate. You ...


1

As I understand from your question is that you to rotate the actual textures and not the polygon vertices. This can be done by modifying the Texture Matrix not the ModelView Matrix.(you're using fixed pipeline). In order to modify the texture matrix that actually transforms the UVs you need to enable it first. glMatrixMode(GL_TEXTURE); glLoadIdentity(); ...


2

SDL2 doesn't need any functionality to be added for either of those items. Texture batching You yourself can sort the sprites by texture used. The SDL backends can already do draw call batching if they wish to (nothing requires that the Copy command be executed immediately; the only requirement is that it be executed by the time any side effects are ...


0

Ok, I found a solution to my problem: ConcurrentDictionary of string, VertexBuffer, ConcurrentDictionary of string, IndexBuffer and ConcurrentDictionary of string, Texture2D. With them, I can create each VertexBuffer and IndexBuffer for a texture name stored in a string. Then I can easily access all data I need: loading a Texture 2D, setting a name for it ...



Top 50 recent answers are included