Let us look at the individual aspects of cultural background mentioned in your question. We will begin with race. Did Leonardo’s race influence his work? I would say yes, insofar as the opportunities that he could access. But his race has to be considered in combination with his gender and...
Let us look at the individual aspects of cultural background mentioned in your question. We will begin with race. Did Leonardo’s race influence his work? I would say yes, insofar as the opportunities that he could access. But his race has to be considered in combination with his gender and social class. Like the vast majority of others born in the region later known as Tuscany, Leonardo was a white European. Both trade and domestic slavery brought people of other races and ethnicities to Renaissance Italy, and their roles varied. Race, together with gender and social class, created either barriers or opportunities. The fact that Leonardo was given at least an informal education and an apprenticeship as a painter had to do with his father’s social status and interest in his son. Leonardo richly built on this learning through his own self-education. However, girls, as well as all children born to peasant or serving classes, were typically not even taught to read.
Another point to consider with regard to race is that if Leonardo had not been of European origin, biographers and historians may well have chosen to overlook his genius and groundbreaking work—both during his lifetime and afterwards. Race can influence not only life opportunities, but also how accomplishments are recorded.
Now let us consider the cultural aspects of religion and politics. Although Leonardo was a man of astounding talent across many disciplines, he was not independently wealthy and had to work for a living. Religion and politics influenced the commissions he was given by the Church and by his patrons, members of the ruling nobility. The Church wanted art that depicted religious scenes, and the ruling nobility often wanted designs for military equipment. Leonardo provided both.
The politics of the times brought wars and upheavals to the small city-states and kingdoms of the land that later became Italy. As the fortunes of any patron fell, Leonardo had to quickly leave one court and seek employment in another.
It is important to remember that Leonardo did not allow cultural conventions or even laws to limit his scientific quests. Two areas of inquiry that he pursued, in spite of possible dangerous repercussions, were his anatomical and astronomical studies. His drive to understand the structure and workings of the human body led him to dissect cadavers--then an illegal activity. He kept his drawings private, in notebooks that were not rediscovered until the 1880s.
Leonardo’s anatomical drawings are so accurate that even in recent times they have been used to guide dissections in medical schools. You can read more about this in the following article:
Forty years before Copernicus came to the same conclusion, Leonardo noted that the earth rotated around the sun and not vice versa. In one of his notebooks, he wrote in capital letters, “IL SOLE NON SI MUOVE” (the sun does not move). The Church had long condemned heliocentricity as a heresy, punishable by death, but this did not prevent him from his quiet pursuit of the truth.
In terms of the cultural aspect of sexuality and how it may have influenced Leonardo’s work, much more is known about the societal taboos of his time than about his personal life. What is only known for certain is that Leonardo never married and had no offspring. In Florence, at the age of 24, he and several other youths were anonymously accused of “sodomy” (homosexuality). Leonardo was arrested and spent two months in jail, but the charges were dropped because no witnesses could be found. The legal punishment could have been as severe as burning at the stake. Some of his drawings in the following months included the design of a machine meant to pull bars from windows. You can read more about this here:
I am sure that you can discover on your own many ways in which Leonardo’s cultural background influenced his work. I recommend Giorgio Vassari’s biography, which you may read at the following site:
Walter Isaacson’s beautifully illustrated biography Leonardo da Vinci (published in 2017) is another excellent and popular resource, available in many libraries.