class_docstr: Base class for all objects that may be included in a GLSL program
  (Functions, Variables, Expressions).
  
  Shader objects have a *definition* that defines the object in GLSL, an
  *expression* that is used to reference the object, and a set of
  *dependencies* that must be declared before the object is used.
  
  Dependencies are tracked hierarchically such that changes to any object
  will be propagated up the dependency hierarchy to trigger a recompile.
class_docstr_tok: ["Base","class","for","all","objects","that","may","be","included","in","a","GLSL","program","(","Functions",",","Variables",",","Expressions",")",".","Shader","objects","have","a","*","definition","*","that","defines","the","object","in","GLSL",",","an","*","expression","*","that","is","used","to","reference","the","object",",","and","a","set","of","*","dependencies","*","that","must","be","declared","before","the","object","is","used",".","Dependencies","are","tracked","hierarchically","such","that","changes","to","any","object","will","be","propagated","up","the","dependency","hierarchy","to","trigger","a","recompile","."]
docstr: Convert *obj* to a new ShaderObject. If the output is a Variable
  with no name, then set its name using *ref*.
docstr_tok: ["Convert","*","obj","*","to","a","new","ShaderObject",".","If","the","output","is","a","Variable","with","no","name",",","then","set","its","name","using","*","ref","*","."]
code: def create(self, obj, ref=None):
      """Convert *obj* to a new ShaderObject. If the output is a Variable
      with no name, then set its name using *ref*.
      """
      if isinstance(ref, Variable):
          ref = ref.name
      elif isinstance(ref, str) and ref.startswith("gl_"):
          # gl_ names not allowed for variables
          ref = ref[3:].lower()
  
      # Allow any type of object to be converted to ShaderObject if it
      # provides a magic method:
      if hasattr(obj, "_shader_object"):
          obj = obj._shader_object()
  
      if isinstance(obj, ShaderObject):
          if isinstance(obj, Variable) and obj.name is None:
              obj.name = ref
      elif isinstance(obj, str):
          obj = TextExpression(obj)
      else:
          obj = Variable(ref, obj)
          # Try prepending the name to indicate attribute, uniform, varying
          if obj.vtype and obj.vtype[0] in "auv":
              obj.name = obj.vtype[0] + "_" + obj.name
  
      return obj
  
imports: from collections import OrderedDict
  from weakref import WeakKeyDictionary
  from .compiler import Compiler
  from .variable import Variable
  from .expression import TextExpression
label_desc: Use image node_id 1 for calling the ShaderObject obj's underlying member method code with example usage: obj.create(obj, ref) and returns: obj