A new means of incorporating radiative transfer into smoothed particle hydrodynamics (SPH) is introduced, which builds on the success of twoprevious methods - the polytropic cooling approximation as devised by Stamatellos et al. and flux-limited diffusion. This hybrid method preserves the strengths of its individual components, while removing the need for atmosphere matching or other boundary conditions to marry optically thick and optically thin regions. The code uses a non-trivial equation of state to calculate temperatures and opacities of SPH particles, which captures the effects of H2 dissociation,H0 ionization, He0 and He+ ionization,ice evaporation, dust sublimation, molecular absorption, bound-free and free-free transitions and electron scattering. The method is tested in several scenarios, including (i) the evolution of a0.07Msolar protoplanetary disc surrounding a0.5Msolar star; (ii) the collapse of a 1Msolarprotostellar cloud and (iii) the thermal relaxation of temperature fluctuations in a static homogeneous sphere.