Anyone that has gone a whole day without sleeping can tell you what an adverse effect it has on their capacity to do anything well. Anyone that has gone the same period of time without eating can tell you an analogous story there are certain things that you require, and without them it doesn't work in the way it should. Nor does your brain. What you are working with your body is a complex organism that will malfunction if it's not treated the best way. This is the reason why working in collusion with nature to guarantee the most impressive results is so important. Putting the right food into your body is a minimum need for a good body building regime.
The work that you need to do to make the exercise effective is sort of demanding. You won't gain muscle without eating protein-rich foods. You won't have the energy for high-impact work without eating carbs.
And without fiber, your body will not operate at the right level of fluency to make all of this work possible and effective. Taking all of this into account, you have to be aware that cheating nature isn't a choice.
Getting the right foods in the right quantities, and getting the relaxation and rest to make sure that all the work is effective, are all essential parts of a worthwhile exercise regime. Don't scrimp on these and presume that you can fill in the gaps, as you simply can't, and it'll catch up on you if you try.