Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 21 Jun 2009
Offline Last Active Today, 11:30 AM

Posts I've Made

In Topic: OpenGL samplers, textures and texture units (design question)

11 January 2015 - 04:34 AM

PS: re-checked. Sampling parameter stored in texture object, not in texture unit.

Binding different textures into same texture unit won't force same filtering on all bound textures.

Sorry, my original post was unclear, I was talking about sampler objects, not sampler parameters. Sampler objects are bound to a texture unit.

In Topic: GLFW and multisampled backbuffer

24 December 2014 - 03:02 AM

I'm curious, what do you need the sample count for?

Writing an OpenGL backend for a framework we use at work. I got an FBO class there which I also want to use for the default FBO, and I need the default FBO description (formats, size, sample count). It's mainly for completness.


Guess I'll have to go the long way to get this info.

In Topic: StructuredBuffer and matrix layout

15 September 2014 - 12:13 PM

Yes, I've seen that behavior as well when using compute shaders. My workaround was to use a StructuredBuffer instead and use 4 loads. In terms of the compiled assembly this isn't really any less efficient, since a float4x4 by will get split into 4 loads when compiled to assembly (you can only load 4 DWORDs at a time from structured buffers).


While searching for an answer I stumbled upon your blog, which is the just about the only place that this packing issue is mentioned (bad MSDN...). I actually used your advise and loaded the 4 vectors myself, just to find out that the skinning shader went from 46 instructions with column-major to 176 instructions with row-major.

I knew that row-major is more inefficient than row-major, but x4 instructions is just too much.

In Topic: Mip mapping issue

12 September 2014 - 04:20 AM

0 isn't a valid value for MaxAnisotropy; it needs to be between 1 and 16: http://msdn.microsoft.com/en-us/library/windows/desktop/ff476207%28v=vs.85%29.aspx
(Note that 1, not 0, is for anisotropic filtering disabled).
I suggest correcting this first, then see if the problems still happen.


This value is ignored in case the filter type is not anisotropic.

Appraently, 0 is indeed a valid value even if the filter type is anisotropic.

D3D11 ERROR: ID3D11Device::CreateSamplerState: MaxAnisotropy must be in the range [0 to 16].  20 specified. [ STATE_CREATION ERROR #226: CREATESAMPLERSTATE_INVALIDMAXANISOTROPY]

In Topic: PBR (blurry reflections)

12 September 2014 - 02:55 AM

As I understand from the articles that I've been reading, the more metallic a surface, the more reflection it has (and less albedo). Is it as simple as this?

Basically, yes. But there's more to it. There are other properties like the reflection color, shape, surface smoothness, etc.

PBR and BRDF is a huge topic, with many different models (Phong-model is a very basic BRDF).


What article are you reading? What are you trying to achieve?

I don't see any PBR in the code you posted. The shader does environment mapping with a very crude constant specular attenuation function. Unless the physics is baked into the env-map, this is not a real physical model.