<div dir="ltr">I am creating a lookup table with discrete rgba entries to map a vtkTexture with unsigned char data to colors. When I render my scene texture is all one color which is the last entry I put into the lookup table. Here is a code snippet of my lookup table and texture:<div><br></div><div>vtkSmartPointer<vtkLookupTable> lookuptable = vtkSmartPointer<vtkLookupTable>::New();</div><div><span class="" style="white-space:pre">                  </span>lookuptable->GetTable()->Reset();</div><div><span class="" style="white-space:pre">                    </span>lookuptable->SetNumberOfColors(cols->Count);</div><div><br></div><div><span class="" style="white-space:pre">                        </span>for (int tblid = 0; tblid < cols->Count; tblid++)</div><div><span class="" style="white-space:pre">                    </span>{</div><div><span class="" style="white-space:pre">                          </span>// Set the ref bin colors</div><div><br></div><div><span class="" style="white-space:pre">                         </span>double r, g, b, a;<span class="" style="white-space:pre">                        </span></div><div><br></div><div><span class="" style="white-space:pre">                          </span>r = cols[tblid].R / 255.0;</div><div><span class="" style="white-space:pre">                         </span>g = cols[tblid].G / 255.0;</div><div><span class="" style="white-space:pre">                         </span>b = cols[tblid].B / 255.0;</div><div><br></div><div><span class="" style="white-space:pre">                                </span>if(tblid <= 20)</div><div><span class="" style="white-space:pre">                         </span>{</div><div><span class="" style="white-space:pre">                                  </span>a = 0;</div><div><span class="" style="white-space:pre">                             </span>}</div><div><span class="" style="white-space:pre">                          </span>else</div><div><span class="" style="white-space:pre">                               </span>{</div><div><span class="" style="white-space:pre">                                  </span>a = cols[tblid].A / 255.0;</div><div><span class="" style="white-space:pre">                         </span>}</div><div><br></div><div><span class="" style="white-space:pre">                         </span>lookuptable->SetTableValue(tblid, r, g, b, a);</div><div><br></div><div><span class="" style="white-space:pre">                 </span>}<span class="" style="white-space:pre">         </span></div><div><br></div><div><span class="" style="white-space:pre">                  </span>lookuptable->Build(); </div><div><br></div><div><div>vtkSmartPointer<vtkTexture> texture = vtkSmartPointer<vtkTexture>::New();<span class="" style="white-space:pre">                        </span></div><div><span class="" style="white-space:pre">                   </span>texture->MapColorScalarsThroughLookupTableOn();</div><div><span class="" style="white-space:pre">                 </span>texture->SetLookupTable(lookuptable);</div><div><span class="" style="white-space:pre">                   </span>texture->InterpolateOff();</div><div><span class="" style="white-space:pre">                      </span>if(m_smooth)</div><div><span class="" style="white-space:pre">                       </span>{</div><div><span class="" style="white-space:pre">                          </span>texture->SetInputConnection(resize2->GetOutputPort());</div><div><span class="" style="white-space:pre">                       </span>}</div><div><span class="" style="white-space:pre">                  </span>else</div><div><span class="" style="white-space:pre">                       </span>{</div><div><span class="" style="white-space:pre">                          </span>texture->SetInputConnection(imgdat->GetOutputPort());</div><div><span class="" style="white-space:pre">                        </span>}</div></div><div><br></div><div>I have searched the documentation for vtkTexture and can't figure out what I am doing wrong.</div></div>