I want to change to use effect, and I have it working now, but I was not able to figure out how to set the constant buffers when using effects, so the 2 update calls
rc.Context.UpdateSubresource<cbObjStruct>(ref m_cbObj, m_perObjcBuf);
rc.Context.UpdateSubresource<cbTransform>(ref m_cbTransform, m_transformcBuf);
turns into this instead (ignore the extra transpose). Is there an easier way to update the constant buffer than setting it per variable? (obviously I will optimize it to per frame and per obj Update)
void Update(RenderContext rc)
{
Matrix m1 = m_cbTransform.gWorld;
m1.Transpose();
EffectMatrixVariable m = m_effect.GetVariableByName("gWorld").AsMatrix();
m.SetMatrix(m1);
m1 = m_cbTransform.gView;
m1.Transpose();
m = m_effect.GetVariableByName("gView").AsMatrix();
m.SetMatrix(m1);
m1 = m_cbTransform.gViewProj;
m1.Transpose();
m = m_effect.GetVariableByName("gViewProj").AsMatrix();
m.SetMatrix(m1);
EffectVectorVariable v = m_effect.GetVariableByName("objColor").AsVector();
v.Set(m_cbObj.ObjColor);
m1 = m_cbObj.ObjWorld;
m1.Transpose();
m = m_effect.GetVariableByName("objWorld").AsMatrix();
m.SetMatrix(m1);
EffectPass renderpass = m_currentRender.GetPassByIndex(0);
renderpass.Apply(rc.Context);
}