Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 08 Mar 2009
Offline Last Active Oct 23 2014 04:05 AM

Posts I've Made

In Topic: Suggestions for a node-based shader / material tool and integration

27 August 2014 - 08:03 PM

Thanks for the post! I'll look into it

In Topic: Sampling Texture2D vs Texture1D?

05 June 2014 - 12:37 AM

Once again, chatting with you all helped me solve the issue.

A couple things seemed to be needed for me to solve this:


1) I changed the Filter type to MIN_MAG_MIP_POINT. linear interpolated across the colors (which...is what it does...)

2) For my usage, I needed to switch the Addressing to CLAMP. 


I don't know if this mattered, but I also:

3) moved the three Texture1D declarations in the shader to an array, and did the DSSetShaderResource as an array...this probably didn't change much but I /think/ is a better approach


Also, I double-checked all the channel values and hand-calculated a bunch to make sure that what I was seeing in the SaveDDSToFile call was in fact what I was inputting -- as it turns out the DDS viewer I am using is a bit weird and unreliable...best to just do the math by hand.


Now, the calculations all seem correct and i'm getting some interesting stuff being done using the 1D textures.

Thanks again (and double thanks to MJP who helped me out twice in 2 weeks!)

In Topic: Stretched pixels in windowed mode

04 June 2014 - 08:00 PM

You should also keep in mind that the ratio of buffer size to window size is important. If your backbuffer is set to say 640 x 480 but your window rectangle is 600 x 480, then the result will look "squashed" as you put it. If the window rectangle was, say, 700 x 480, then it would look "stretched."


As a rule I like to not optimize unless I must, and also try to keep things simple until it needs to be changed...thus I would suggest that your backbuffer and window rect keep the width and height in constant ratio of each other. I like to use multiples of the back buffer. Again, this isn't "optimal" as much as I just follow the rule: "get it to look right before getting to be fast."

In Topic: Sampling Texture2D vs Texture1D?

04 June 2014 - 07:21 PM


Its a tiny 1-d texture so I don't do mipmap sampling. Yes, I'm doing it in the Domain Shader because of something I'm trying out which needs access to the vertex location properties.



As MJP points out, the sampling is happening in the domain shader so I can't use the default Sample function. 


To clarify, I don't want the component value of the RGBA texture value at location 0, i want the ENTIRE value.

The 4-d rgba value is (1,0,0,1) where if I do SampleLevel(DomainSampler, 0, 0) and just send that value straight to the Pixel Shader, it should produce red.

I'll double check the texture, but the output I get when i cut it to file seems right. 


The input to the texture is the following:

(1,0,0,1) and (0,0,1,1)

So, I have two pixels where the first one is RGBA of Red, the second of Blue, and i want the color value in its whole (not as components, aka JUST the x or y value).

I don't understand how, but is it possible that SampleLevel(DomainSampler, 0, 0) is  somehow sampling with the wrong channel bit size? I've set the shader resource view to use the same channel bit information

In Topic: Sampling Texture2D vs Texture1D?

04 June 2014 - 04:18 AM

I should note I am using DX11 exclusively :)