Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 748093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:16:49+00:00 2026-05-14T14:16:49+00:00

I have a tex2D sampler I want to only return precisely those colours that

  • 0

I have a tex2D sampler I want to only return precisely those colours that are present on my texture. I am using Shader Model 3, so cannot use load.

In the event of a texel overlapping multiple colours, I want it to pick one and have the whole texel be that colour.

I think to do this I want to disable mipmapping, or at least trilinear filtering of mips.

sampler2D gColourmapSampler : register(s0) = sampler_state {
    Texture = <gColourmapTexture>; //Defined above
    MinFilter = None; //Controls sampling. None, Linear, or Point.
    MagFilter = None; //Controls sampling. None, Linear, or Point.
    MipFilter = None; //Controls how the mips are generated. None, Linear, or Point.
    //...
};

My problem is I don’t really understand Min/Mag/Mip filtering, so am not sure what combination I need to set these in, or if this is even what I am after.

What a portion of my source texture looks like;
http://img689.imageshack.us/img689/6171/sourcev.png

Screenshot of what the relevant area looks like after the full texture is mapped to my sphere;
http://img717.imageshack.us/img717/9202/resultc.png

The anti-aliasing/blending/filtering artefacts are clearly visible; I don’t want these.


MSDN has this to say;

D3DSAMP_MAGFILTER: Magnification filter of type D3DTEXTUREFILTERTYPE

D3DSAMP_MINFILTER: Minification filter of type D3DTEXTUREFILTERTYPE.

D3DSAMP_MIPFILTER: Mipmap filter to use during minification. See D3DTEXTUREFILTERTYPE.

D3DTEXF_NONE: When used with D3DSAMP_MIPFILTER, disables mipmapping.

Another good link on understanding hlsl intrinsics.


RESOLVED

Not an HLSL issue at all! Sorry all. I seem to ask a lot of questions that are impossible to answer. Ogre was over-riding the above settings. This was fixed with;

Ogre::MaterialManager::getSingleton().setDefaultTextureFiltering(Ogre::FO_NONE , Ogre::FO_NONE, Ogre::FO_NONE);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:16:50+00:00Added an answer on May 14, 2026 at 2:16 pm

    What it looks to me is that you’re getting the values from a lower level mip-map (unfiltered) than the highest detail you’re showing.

    MipFilter = None 
    

    should prevent that, unless something in the code overrides it. So look for calls to SetSamplerState.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a shader that looks like this: void main( in float2 pos :
Have just started using Google Chrome , and noticed in parts of our site,
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I have code that needs to render regions of my object differently depending on
I'm working on a shader that generates little clouds based on some mask images.
I'm using ctags to create a tags file for use in Vim, so that
Have finally got a responsive site working (of a fashion). What I want to
Have some code: using (var ctx = new testDataContext()) { var options = new
I am using a va_list to construct a string that is rendered. void Text2D::SetText(const
Have some dates in my local Oracle 11g database that are in this format:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.