A model for valuing a European-style commodity option and a futures option is discussed with a view to incorporating the impact of changing hidden economic conditions on commodity price dynamics. The proposed model may be thought of as an extension to the Gibson-Schwartz two-factor model, where the model parameters vary when the hidden state of an economy switches. A semi-analytical approach to valuing commodity options and futures options is adopted, where the closed-form expressions for the characteristic functions of the logarithmic commodity price and futures price are derived. A fast Fourier transform (FFT) approach is then applied to provide a practical and efficient way to evaluate the option prices. Real data studies and numerical examples are used to illustrate the practical implementation of the model.