casting issues solved in shader