Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


bobobobo

Member Since 09 Mar 2010
Offline Last Active Apr 24 2014 02:50 AM

Posts I've Made

In Topic: GL_POINTS Distance Attenuation

16 September 2012 - 02:20 PM

Another way to do this is just use normalized device coordinates,

// vertex shader:
gl_Position = modelViewProjectionMatrix * position ;
vec3 ndc = gl_Position.xyz / gl_Position.w ; // perspective divide.

float zDist = 1.0-ndc.z ; // 1 is close (right up in your face,)
// 0 is far (at the far plane)
gl_PointSize = 50.0*zDist ; // between 0 and 50 now.

psColor = vec4( color, 1 ) ;
psColor.xyz = vec3( zDist, zDist, zDist ) ;

Posted Image

I'm not sure this is exactly what point distance attenuation did in 1.0, but it works pretty well

In Topic: D3DX10SaveTextureToFile

26 October 2011 - 02:07 PM

Actually DXGI_FORMAT_B8G8R8A8_UNORM does not save (generates quoted error), the format that works without fail for me is DXGI_FORMAT_R8G8B8A8_UNORM.

In Topic: Can you cpu access a texcube you load from a DDS?

27 September 2011 - 07:09 PM

You can only read STAGING resources on the CPU. So you should load your cubemap as STAGING, do your manipulations, and then using the staging data to initialize an IMMUTABLE resource.


Yes. These are the params that worked:


// to load it here you actually have to load it AGAIN as a STAGING texture.
ID3D11Texture2D* stageCubeTex ;


D3DX11_IMAGE_LOAD_INFO loadInfo ;
loadInfo.MiscFlags = D3D11_RESOURCE_MISC_FLAG::D3D11_RESOURCE_MISC_TEXTURECUBE ;
loadInfo.Usage = D3D11_USAGE::D3D11_USAGE_STAGING;
loadInfo.CpuAccessFlags = D3D11_CPU_ACCESS_FLAG::D3D11_CPU_ACCESS_READ;
loadInfo.FirstMipLevel = 0 ;
loadInfo.MipLevels = 1 ;
loadInfo.BindFlags = 0 ;


DX_CHECK( D3DX11CreateTextureFromFileA( d3d, "C:/SHARE/res/office.dds", &loadInfo, 0, (ID3D11Resource**)&stageCubeTex, 0 ), "load texture cube STAGING" );


D3D11_TEXTURE2D_DESC stageCubeTexDesc ;
stageCubeTex->GetDesc(&stageCubeTexDesc);

So I'm basically loading it twice. The staging one gets discarded after I work with it.

In Topic: How to use D2D with D3D11?

09 August 2011 - 08:12 AM

Here's a couple of implementation references for D2D over D3D11

http://will-sherif.appspot.com/html/d3d11+DirectWrite.html
http://braynzarsoft.mezoka.com/index.php?p=D3D11FONT

In Topic: FMOD play overlapping sounds

09 March 2010 - 03:35 PM

WAIT, NEVERMIND.

I had loaded the sound with FMOD_CREATESTREAM, which is why it kept starting the sound over again.

Carry on.

PARTNERS