Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

173 Neutral

About pekarn

  • Rank

Personal Information

  1. pekarn

    Gamma Correction

    Yes and that is my understanding of how it should work. What I'm saying is that if I output a linear gradient without any correction my eyes perceive it as linear on the monitor aswell, if I apply correction to it then it doesn't look linear anymore. Basically the color that I perceive on the monitor matches the linear values that I output from the shader. Which, as you say, is not what should happen, and that's why I'm confused.
  2. Hello! I'm currently trying to make sure that my engine handles gamma in a correct way. The problem is the results that I'm getting contradict my understanding of how it should work (based on what I've read). The test that I'm doing is from the shader use the screen uv to output a linear gradient from black to white. I currently do no correction at all (my backbuffer format is not a srgb format, I don't set any gamma ramp, the shader doesn't do any correction). Based on my understanding this would result in the gradient that I see on my monitor being incorrect since I don't do any correction. However the result I see is a gradient that looks linear. When I try to apply correction the gradient ends up looking non-linear.   So basically when I don't do any correction at all I get what seems like correct results. According to the settings on my monitor it's using 2.2 gamma. I looked in NVIDIA control panel and the gamma override setting there is turned off as it should be. Interestingly if I enable it and change the gamma the image will change gamma for a bit less than a second and then it seems something else will override it and the image will look normal again even though the slider is still set to something different.   I've tried messing around with this (http://mynameismjp.wordpress.com/2010/04/30/a-closer-look-at-tone-mapping/) tonemapping sample. If I do the same thing and output a linear gradient from the shader in that sample I will get an incorrect output on the monitor because it uses an srgb backbuffer.   I'm just really confused right now as to what's going on so any help to sort it out would be great.   Thanks
  3. pekarn

    StructuredBuffer vs Buffer

    Thanks for your replies. :)
  4. Hello! Direct3D 11 added several new resource types for shaders. The ones of interest for this post is Buffer, StructuredBuffer and ByteAddressBuffer. I have some questions about the differences between them. I have mostly used StructuredBuffer before and occasionally Buffer. I have never used ByteAddressBuffer. I mostly care about Buffer and StructuredBuffer but figured I'd include ByteAddressBuffer aswell.   I know that with a regular Buffer the data in the buffer can have a different format than what you declare it with in the shader and the GPU will automatically do the conversion just like when you sample a texture or pass in data in a vertex buffer. With a StructuredBuffer the data has to match the declaration in the shader which limits you to HLSL types.   Other than that and the syntax difference is there any other difference between Buffer and StructuredBuffer? Any difference in performance? If my data isn't stored in a different format than how I use it in the shader is there any reason to use Buffer over StructuredBuffer?   For example is there any difference between these two (assuming that the data in the buffer are regular uncompressed floats)? struct SData { float f; }; StructuredBuffer< SData > Buf; Buffer< float > Buf;     Another example, would it make any difference for performance or anything else between these two? struct SData { float f; uint i; }; StructuredBuffer< SData > Buf; Buffer< float > Buf1; Buffer< uint > Buf2;     And finally, what's the reason to use a ByteAddressBuffer? Like I said I've never used them so I just know what the documentation says. You can't access individual bytes, you have to access whole uint values. So why use a ByteAddressBuffer over something like: Buffer< uint > Buf;     Thanks for helping me clear this up.
  5. As far as I know there is no easy solution to this. You have to either split into multiple draw calls and change the parameters for the draw call to do the offset, but obviosly you don't want to do that because the goal was to reduce draw calls. The only other way (that I can think of) is to apply the offset to the indices that you put in the buffer.
  6. pekarn

    Container Access Problem

    Actually std::list has a member function remove_if that will do this more efficiently (because it doesn't have to move the elements). So the above code would be replaced by [source lang="cpp"]List.remove_if( [](const SayProcess& lp) -> bool { lp.Say(); return true; } );[/source] This is only for list though. If your container is std::vector for example you have to use the erase-remove idiom demonstrated by dimitri.adamou. Also I believe lambda functions can only leave out the return type if the function consists of only a single return statement. I added the return type in my code above.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!