Baking Texture Doesn't Give the Correct Output

Total noob here so I apologize if I’m using the wrong jargon. My goal is to export my project as .glb but I’m having an issue with a part of the project that’s using texture nodes. When I export it directly, this object comes out completely white.

I made a part of my project that uses these Shader nodes to make a color gradient (Namely: Texture Coordinate—Mapping— Separate XYZ—Color Ramp— Principled BSDF—Material Output + Image Texture)

I know that I need to export the texture of that object separately, but the best I can get is a solid-colored output, not the gradient.

When I bake the texture using Cycles and Bake type as Diffuse, I get a semi-opaque black output, which is also wrong

I would really appreciate it if someone could tell me what I’m doing wrong. Thanks a lot!

Hey, orkunoz. I have had some difficulties in the past with baking textures myself, but you’re on the right track with bake type as diffuse. Has the object been UV-unwrapped?

I’m not sure I totally follow your node setup, can you attach screenshot or a small .blend file that shows your issue?

Hi smws. Thanks for looking into it.

I finally made it work.

I tried baking textures on a cube and it worked just fine.

My original object was extruded from a flat svg file and was way complicated than it should be. so i simply took the difference between my object and a cube using boolean modifier. this new object created as a result works just fine.

I still have no clue what caused the main issue but I’m happy that I have a company logo that I can put in a VR showroom now.