Accurate modeling of X-ray path length is crucial for quantitative X-ray spectroscopy, significantly influencing intensity and detectability, particularly in Micro-PIXE/XRF analysis of samples with complex topographies [1]. This study presents a comprehensive 3-D simulation model developed to investigate X-ray path length and resultant yield variations due to surface roughness. The model simulates surface topography in 1-D, 2-D, and 3-D, integrating key physical parameters such as stopping power, X-ray production cross-sections, photon attenuation, and local photon creation to estimate X-ray intensity maps. A critical feature is its ability to account for severe surface roughness where X-rays may exit and re-enter the sample multiple times en route to the spectrometer. The model was validated by calculating X-ray path lengths and their effects on accumulated X-ray yield using both mathematically generated topographies and experimental Micro-PIXE data from pure Ti and structured brass alloys, acquired with a four-segment silicon drift detector (SDD) [2]. Results demonstrate a remarkable correlation between detailed path length calculations and observed X-ray yields, highlighting the substantial impact of microscale roughness. This approach promises to enhance the accuracy of X-ray intensity predictions, leading to more precise elemental composition analysis in Micro-PIXE and related X-ray spectroscopy techniques.