I'm using Blender 3.5.1
What I Want To Achieve
I am creating a Procedural Planet Generator with Geometry Nodes.
For this purpose I prepared two materials - one for the surface (surface) & one for the atmosphere and clouds (volume).
In Geometry Nodes, I generate two spheres and apply the aforementioned materials to them. Each sphere receives its respective material.
Now I would like to drive the generation process entirely through Geometry Node Group Inputs, but most of the variables and colors that can be dialed and changed are located in the Shader Group Inputs.
No matter what I try, I simply cannot get float values from Geometry Nodes to the Shader.
What I Tried
- I tried feeding in the geometry node Group Input values directly to the Group Output and then getting these values in the Shader via the Attribute node (I tried declaring the variable type as Geometry, Instance, etc.) but to no avail. (see picture)
Then I tried it by Store Named Attribute which I placed in Geometry Nodes before assigning the material. Then I tried it after setting the material and tried all different ways to store it inside the geometry (points, lines, splines, instance, etc.)
Then I tried to create the attribute in the Object Data Properties but still couldn't receive any values from within the Shader. I made sure that the attribute names are correct and identical.
Now I really ran out of options/ideas and overall patience. All I want is to get a simple float value (field? It seems all Geo Node outputs besides Geometry are fields, no matter what you do) from GeoNodes to Shader.
It cannot be that difficult, can it? All tutorials and related posts I found suggested the above way but none of them worked for me.
EDIT: Here is the Blend file: https://www.dropbox.com/s/5w491kfe7acgxou/Geometry%20Nodes.blend?dl=0
EDIT 2: I have tried all suggestions from here but it still won't work. I also tried Blender 3.3 but with the same outcome. It appears as if the Attribute never receives the value from Geometry Node. Its output always equals 0 (NaN).
SOLUTION: Gordons suggestion solved the problem. The solution works as long as I do not plugin the Realize Istance after the Instance of points node.