Shiva came to Vasugupta in a dream, they say. He showed the sage the location of a huge rock in a forest at the foot of a mountain. When the rock was turned over, a sacred text was revealed on the side that had been hidden. Following the dream, Vasugupta brought through the Shiva Sutras, one of the most important texts of Kashmir Shaivism.
Vasugupta also wrote (c.900) a commentary on the Shiva Sutras known as the Spanda Karika, or “Song of Divine Vibration”. This tantric text is one of the great expositions of the importance of spending more time in the twilight zone of hypnagogia, in order to expand consciousness, develop dream lucidity and lift the Veil between the worlds.
You start from a conscious waking state. You are encouraged to perform breathing exercises, placing yourself at the junction between inhaled and exhaled breaths, maintaining lucidity as dreams arise. When this is accomplished by the conscious or lucid dreamer
The Lord of necessity grants him during dreams the ends he pursues, providing that he is profoundly contemplative and places himself at the junction between waking and sleeping.
The aim is to retain consciousness at all times, whether waking, sleeping, or in an intermediate state. The adept attains the Fourth State called turiya in the Upanishads, a state of waking to the reality of the Self. When this has been accomplished, “the Fourth State penetrates waking, dreaming and deep sleep.”