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 6653135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:13:52+00:00 2026-05-26T01:13:52+00:00

My problem is that, if I use BasicEffect (and setup VertexColorEnabled = true) or

  • 0

My problem is that, if I use BasicEffect (and setup VertexColorEnabled = true) or my own shader, and use only colored (not textured!) models, it gives the error that Color0 is missing…Isn’t it weird that .fbx models do not come with COLOR0 channel ?

  • 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-26T01:13:53+00:00Added an answer on May 26, 2026 at 1:13 am

    Here is what I found….. (Marshall Belew @ forums.create.msdn.com/forums/p/16066/553792.aspx#553792) Saved my day…

    The solution is simple: the BasicShader has a DiffuseColor property. I merely added a new field into the Toon shader, and any time there was no texture, I substituted the color value.

    I am happier with this solution because now I don’t have to write a ton of vertex declaration / draw primitive logic.

    From the .fx file:

    // Pixel shader applies a cartoon shading algorithm. 
    float4 ToonPixelShader(LightingPixelShaderInput input) : COLOR0 
    { 
        float4 color = TextureEnabled ? tex2D(Sampler, input.TextureCoordinate) : DiffuseColor; 
    

    Replacing the effects (this is a modified snipet from the NonPhotoRealistic sample).

    // Scan over all the effects currently on the mesh. 
    foreach (BasicEffect oldEffect in mesh.Effects) 
    { 
       // If we haven't already seen this effect... 
       if (!effectMapping.ContainsKey(oldEffect)) 
       { 
          // Make a clone of our replacement effect. We can't just use 
          // it directly, because the same effect might need to be 
          // applied several times to different parts of the model using 
          // a different texture each time, so we need a fresh copy each 
          // time we want to set a different texture into it. 
          Effect newEffect = replacementEffect.Clone( 
                                      replacementEffect.GraphicsDevice); 
    
          // Copy across the texture from the original effect. 
          newEffect.Parameters["Texture"].SetValue(oldEffect.Texture); 
    
          newEffect.Parameters["TextureEnabled"].SetValue( 
                                              oldEffect.TextureEnabled); 
    
          Vector4 color = new Vector4(oldEffect.DiffuseColor, 1.0f); 
          newEffect.Parameters["DiffuseColor"].SetValue(color); 
    
          effectMapping.Add(oldEffect, newEffect); 
       } 
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created several small applications that use my own DLL. The problem is,
In a couple of scripts that I use I have problem that is intermittent.
I create new ASP.NET web application that use SMTP to send message. The problem
I find I've been confused by the problem that when I needn't to use
I need to use something like get_or_create() but the problem is that I have
I am using wordpress and use custom permalink structure: /%category%/%postname%/ My problem is that
I am using VIM in Windows. The problem is that I want to use
I use Spring MVC [version: 2.5] and Security[version: 2.0.4]. My problem looks like that:
The Problem I use a tool at work that lets me do queries and
it seems that I just solved my problem why I couldn't use the ASP.NET

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.